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

Unified Diff: test/fuzzer/wasm-asmjs.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 | « test/fuzzer/wasm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/fuzzer/wasm-asmjs.cc
diff --git a/test/fuzzer/wasm-asmjs.cc b/test/fuzzer/wasm-asmjs.cc
index 959faa21eb7acdcccbc711fad94bede71607265a..3f7477bf1486b57a29b71b3aa707f9ca64b406c4 100644
--- a/test/fuzzer/wasm-asmjs.cc
+++ b/test/fuzzer/wasm-asmjs.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 | « test/fuzzer/wasm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698