From db66e646df6512d4eb2be344778001c62402e4c5 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 22 Sep 2017 12:52:35 -0700 Subject: 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)) --- src/wasm/wasm-validator.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/wasm/wasm-validator.cpp') 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; -- cgit v1.2.3