Skip to content

Commit

Permalink
fuzz: ignore out of fuel vs stack overflow diff (#1822)
Browse files Browse the repository at this point in the history
Signed-off-by: Takeshi Yoneda <[email protected]>
  • Loading branch information
mathetake authored Oct 30, 2023
1 parent 6f16354 commit a4df8d3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/integration_test/fuzz/wazerolib/nodiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,16 @@ func ensureInstantiationError(compilerErr, interpErr error) (okToInvoke bool, er
interpErrMsg = interpErrMsg[:strings.Index(interpErrMsg, "\n")]
}

if strings.Contains(compilerErrMsg, "stack overflow") && strings.Contains(interpErrMsg, "unreachable") {
// This is the case where the compiler reached stack overflow, but the interpreter reached the unreachable out of "fuel" during
// start function invocation. This is fine.
return false, nil
}

if !allowedErrorDuringInstantiation(compilerErrMsg) {
return false, fmt.Errorf("invalid error occur with compiler: %v", compilerErr)
return false, fmt.Errorf("invalid error occur with compiler: %v vs interpreter: %v", compilerErr, interpErr)
} else if !allowedErrorDuringInstantiation(interpErrMsg) {
return false, fmt.Errorf("invalid error occur with interpreter: %v", interpErrMsg)
return false, fmt.Errorf("invalid error occur with interpreter: %v vs compiler: %v", interpErr, compilerErr)
}

if compilerErrMsg != interpErrMsg {
Expand Down

0 comments on commit a4df8d3

Please sign in to comment.