summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-validator.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2017-09-22 12:52:35 -0700
committerGitHub <noreply@github.com>2017-09-22 12:52:35 -0700
commitdb66e646df6512d4eb2be344778001c62402e4c5 (patch)
treebcc070601de788d6ffa407164f2ce00ac3bab128 /src/wasm/wasm-validator.cpp
parentb29158db92c6fdab578b8b550cb965b020901768 (diff)
downloadbinaryen-db66e646df6512d4eb2be344778001c62402e4c5.tar.gz
binaryen-db66e646df6512d4eb2be344778001c62402e4c5.tar.bz2
binaryen-db66e646df6512d4eb2be344778001c62402e4c5.zip
Update text syntax for shared memory limits (#1197)
Following WebAssembly/threads#58 e.g. (memory $0 23 256 shared) is now (memory $0 (shared 23 256))
Diffstat (limited to 'src/wasm/wasm-validator.cpp')
-rw-r--r--src/wasm/wasm-validator.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp
index 85e2193fa..cfe84ac3e 100644
--- a/src/wasm/wasm-validator.cpp
+++ b/src/wasm/wasm-validator.cpp
@@ -597,6 +597,7 @@ static bool checkOffset(Expression* curr, Address add, Address max) {
void WasmValidator::visitMemory(Memory *curr) {
shouldBeFalse(curr->initial > curr->max, "memory", "memory max >= initial");
shouldBeTrue(curr->max <= Memory::kMaxSize, "memory", "max memory must be <= 4GB");
+ shouldBeTrue(!curr->shared || curr->hasMax(), "memory", "shared memory must have max size");
Index mustBeGreaterOrEqual = 0;
for (auto& segment : curr->segments) {
if (!shouldBeEqual(segment.offset->type, i32, segment.offset, "segment offset should be i32")) continue;