Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Unified Diff: test/fuzzer/wasm.cc

Issue 1760033002: Reset isolate exceptions in libfuzzer wasm tests. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/fuzzer/wasm-asmjs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | test/fuzzer/wasm-asmjs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698