diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-02-23 13:55:55 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-02-23 13:55:55 -0800 |
commit | 3121d8ce04d265032e1d7753b97a0cf17f8725c3 (patch) | |
tree | 64329bd9ca958f36574455a1438aa8a6b1fc4caf /src | |
parent | 817d92d7dd48752f6c0a82989ecfbde4553ad066 (diff) | |
download | binaryen-3121d8ce04d265032e1d7753b97a0cf17f8725c3.tar.gz binaryen-3121d8ce04d265032e1d7753b97a0cf17f8725c3.tar.bz2 binaryen-3121d8ce04d265032e1d7753b97a0cf17f8725c3.zip |
grow memory returns a value now, and we can update the spec tests after doing that
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-interpreter.h | 3 | ||||
-rw-r--r-- | src/wasm.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 59e42783d..2a841f6fd 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -579,6 +579,7 @@ private: case GrowMemory: { Flow flow = visit(curr->operands[0]); if (flow.breaking()) return flow; + int32_t ret = instance.memorySize; uint32_t delta = flow.value.geti32(); if (delta % pageSize != 0) trap("growMemory: delta not multiple"); if (delta > uint32_t(-1) - pageSize) trap("growMemory: delta relatively too big"); @@ -587,7 +588,7 @@ private: if (newSize > instance.wasm.memory.max) trap("growMemory: exceeds max"); instance.externalInterface->growMemory(instance.memorySize, newSize); instance.memorySize = newSize; - return Literal(); + return Literal(ret); } case HasFeature: { IString id = curr->nameOperand; diff --git a/src/wasm.h b/src/wasm.h index 4c8dca331..ec2cd469e 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -1017,7 +1017,7 @@ public: break; } case GrowMemory: { - type = none; + type = i32; break; } default: abort(); |