Commit 9d5822a8 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[wasm] WasmGrowMemory runtime function must return Smi

The WasmGrowMemory builtin (defined in builtins-wasm-gen.cc) expects
the runtime function to return a Smi. Thus ensure that we are really
always returning a Smi.

R=mstarzinger@chromium.org

Change-Id: I153d75a2ab8773adbcce01e9aa125a234c93d077
Reviewed-on: https://chromium-review.googlesource.com/1131737Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54411}
parent 7bff339e
......@@ -80,8 +80,11 @@ RUNTIME_FUNCTION(Runtime_WasmGrowMemory) {
DCHECK_NULL(isolate->context());
isolate->set_context(instance->native_context());
return *isolate->factory()->NewNumberFromInt(WasmMemoryObject::Grow(
isolate, handle(instance->memory_object(), isolate), delta_pages));
int ret = WasmMemoryObject::Grow(
isolate, handle(instance->memory_object(), isolate), delta_pages);
// The WasmGrowMemory builtin which calls this runtime function expects us to
// always return a Smi.
return Smi::FromInt(ret);
}
RUNTIME_FUNCTION(Runtime_ThrowWasmError) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment