Index: test/fuzzer/wasm.cc |
diff --git a/test/fuzzer/wasm.cc b/test/fuzzer/wasm.cc |
index bb02c1990c661c8543c9c6dead7b60555bf1ce1e..8750cbf78617850fae0cf45c06eed6250aee6448 100644 |
--- a/test/fuzzer/wasm.cc |
+++ b/test/fuzzer/wasm.cc |
@@ -8,6 +8,7 @@ |
#include "include/v8.h" |
#include "src/factory.h" |
+#include "src/isolate-inl.h" |
#include "src/isolate.h" |
#include "src/objects-inl.h" |
#include "src/objects.h" |
@@ -20,6 +21,12 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { |
v8::Isolate* isolate = support->GetIsolate(); |
v8::internal::Isolate* i_isolate = |
reinterpret_cast<v8::internal::Isolate*>(isolate); |
+ |
+ // Clear any pending exceptions from a prior run. |
+ if (i_isolate->has_pending_exception()) { |
+ i_isolate->clear_pending_exception(); |
+ } |
+ |
v8::Isolate::Scope isolate_scope(isolate); |
v8::HandleScope handle_scope(isolate); |
v8::Context::Scope context_scope(support->GetContext()); |