Index: src/runtime/runtime-wasm.cc |
diff --git a/src/runtime/runtime-wasm.cc b/src/runtime/runtime-wasm.cc |
index d7e1dba54f7f18f10946e1397c49e064d707c1c0..3ed63879add0dd24a128c273ff0075f92070f276 100644 |
--- a/src/runtime/runtime-wasm.cc |
+++ b/src/runtime/runtime-wasm.cc |
@@ -55,6 +55,14 @@ RUNTIME_FUNCTION(Runtime_WasmGrowMemory) { |
Object* ThrowRuntimeError(Isolate* isolate, int message_id, int byte_offset, |
bool patch_source_position) { |
HandleScope scope(isolate); |
+ DCHECK_NULL(isolate->context()); |
+ StackFrameIterator it(isolate); |
+ it.Advance(); |
+ CHECK(it.frame()->is_wasm_compiled()); |
+ isolate->set_context(*WasmCompiledFrame::cast(it.frame()) |
+ ->wasm_instance() |
+ ->compiled_module() |
+ ->native_context()); |
Handle<Object> error_obj = isolate->factory()->NewWasmRuntimeError( |
static_cast<MessageTemplate::Template>(message_id)); |