Commit 2bc78a1c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm][fuzzer] Improve error output for exception mismatch

The current output of release builds is not very helpful, as it does
not contain the line number, nor the values of {expect_exception} or
{i_isolate->has_pending_exception()}.

R=ahaas@chromium.org

Bug: chromium:854011
Change-Id: I0bc1b8be6151d5420310eb67b2ebd0dc866fc9a6
Reviewed-on: https://chromium-review.googlesource.com/1122869Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54164}
parent d7c86de8
......@@ -342,7 +342,11 @@ int WasmExecutionFuzzer::FuzzWasmModule(const uint8_t* data, size_t size,
// result_turbofan. Therefore we do not check the equality of the results
// if the execution may have produced a NaN at some point.
if (!possible_nondeterminism) {
CHECK_EQ(expect_exception, i_isolate->has_pending_exception());
if (expect_exception != i_isolate->has_pending_exception()) {
const char* exception_text[] = {"no exception", "exception"};
FATAL("interpreter: %s; turbofan: %s", exception_text[expect_exception],
exception_text[i_isolate->has_pending_exception()]);
}
if (!expect_exception) CHECK_EQ(result_interpreter, result_turbofan);
}
......@@ -365,7 +369,11 @@ int WasmExecutionFuzzer::FuzzWasmModule(const uint8_t* data, size_t size,
"main", num_args, compiler_args.get());
}
if (!possible_nondeterminism) {
CHECK_EQ(expect_exception, i_isolate->has_pending_exception());
if (expect_exception != i_isolate->has_pending_exception()) {
const char* exception_text[] = {"no exception", "exception"};
FATAL("interpreter: %s; liftoff: %s", exception_text[expect_exception],
exception_text[i_isolate->has_pending_exception()]);
}
if (!expect_exception) CHECK_EQ(result_interpreter, result_liftoff);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment