fuzz: ignores the stack detail during stack overflow (#1849)

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This commit is contained in:
Takeshi Yoneda
2023-11-27 10:22:58 +09:00
committed by GitHub
parent 1afa54fee4
commit 9ec72567db

View File

@@ -349,10 +349,13 @@ func ensureInvocationError(compilerErr, interpErr error) error {
interpErrMsg = interpErrMsg[:strings.Index(interpErrMsg, "\n")]
}
if strings.Contains(compilerErrMsg, "stack overflow") && strings.Contains(interpErrMsg, "unreachable") {
if compiledStackOverFlow := strings.Contains(compilerErrMsg, "stack overflow"); compiledStackOverFlow && strings.Contains(interpErrMsg, "unreachable") {
// Compiler is more likely to reach stack overflow than interpreter, so we allow this case. This case is most likely
// that interpreter reached the unreachable out of "fuel".
return nil
} else if interpreterStackOverFlow := strings.Contains(interpErrMsg, "stack overflow"); compiledStackOverFlow && interpreterStackOverFlow {
// Both compiler and interpreter reached stack overflow, so we ignore diff in the content of the traces.
return nil
}
if compilerErrMsg != interpErrMsg {