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

Unified Diff: src/wasm/wasm-js.cc

Issue 2825073002: [wasm] Fix DCHECK handiling pending exceptions. (Closed)
Patch Set: formatting Created 3 years, 8 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/mjsunit/regress/wasm/regress-712569.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/wasm/wasm-js.cc
diff --git a/src/wasm/wasm-js.cc b/src/wasm/wasm-js.cc
index 93b396ba9a0365c8e9b803d26581cbbd7b2b1729..46a357e77675997875feaccd787849876d4da11b 100644
--- a/src/wasm/wasm-js.cc
+++ b/src/wasm/wasm-js.cc
@@ -32,12 +32,15 @@ namespace v8 {
namespace {
-#define ASSIGN(type, var, expr) \
- Local<type> var; \
- do { \
- if (!expr.ToLocal(&var)) { \
- DCHECK(i_isolate->has_pending_exception()); \
- } \
+#define ASSIGN(type, var, expr) \
+ Local<type> var; \
+ do { \
+ if (!expr.ToLocal(&var)) { \
+ DCHECK(i_isolate->has_scheduled_exception()); \
+ return; \
+ } else { \
+ DCHECK(!i_isolate->has_scheduled_exception()); \
+ } \
} while (false)
// TODO(wasm): move brand check to the respective types, and don't throw
@@ -125,7 +128,7 @@ i::wasm::ModuleWireBytes GetFirstArgumentAsBytes(
return i::wasm::ModuleWireBytes(start, start + length);
}
-i::MaybeHandle<i::JSReceiver> GetValueAsImports(const Local<Value>& arg,
+i::MaybeHandle<i::JSReceiver> GetValueAsImports(Local<Value> arg,
ErrorThrower* thrower) {
if (arg->IsUndefined()) return {};
@@ -320,8 +323,9 @@ void WebAssemblyInstantiateToPairCallback(
const uint8_t* module_str = reinterpret_cast<const uint8_t*>("module");
Local<Value> instance;
if (!WebAssemblyInstantiateImpl(isolate, module, args.Data())
- .ToLocal(&instance))
+ .ToLocal(&instance)) {
return;
+ }
Local<Object> ret = Object::New(isolate);
Local<String> instance_name =
« no previous file with comments | « no previous file | test/mjsunit/regress/wasm/regress-712569.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698