Index: test/fuzzer/wasm-code.cc |
diff --git a/test/fuzzer/wasm-code.cc b/test/fuzzer/wasm-code.cc |
index feb3e24618f8975cafa7d1ce5bbf7a0971cb28e8..75ce838fd23e44eefbc324b420e8ba974dc66964 100644 |
--- a/test/fuzzer/wasm-code.cc |
+++ b/test/fuzzer/wasm-code.cc |
@@ -7,6 +7,7 @@ |
#include "include/v8.h" |
#include "src/isolate.h" |
+#include "src/objects.h" |
#include "src/wasm/encoder.h" |
#include "src/wasm/wasm-interpreter.h" |
#include "src/wasm/wasm-module.h" |
@@ -14,6 +15,8 @@ |
#include "test/common/wasm/wasm-module-runner.h" |
#include "test/fuzzer/fuzzer-support.h" |
+#define WASM_CODE_FUZZER_HASH_SEED 83 |
+ |
using namespace v8::internal::wasm; |
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
@@ -92,6 +95,14 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
CHECK(i_isolate->has_pending_exception()); |
i_isolate->clear_pending_exception(); |
} else { |
+ if (result_interpreted != result_compiled) { |
+ V8_Fatal( |
+ __FILE__, __LINE__, |
+ "Interpreter result (%d) != compiled module result (%d). Hash: %u", |
+ result_interpreted, result_compiled, |
+ v8::internal::StringHasher::HashSequentialString( |
+ data, static_cast<int>(size), WASM_CODE_FUZZER_HASH_SEED)); |
+ } |
CHECK_EQ(result_interpreted, result_compiled); |
} |
return 0; |