summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-08-23 12:39:33 -0700
committerGitHub <noreply@github.com>2022-08-23 12:39:33 -0700
commit0ee15961e43e0282b014e4328458e065b6976ba7 (patch)
tree5b9f62084e2af1bbfcfc1d27f76a1e826a03a3b0 /test
parent4b635ecc3ef9ab56afab8061faba69c07eb38740 (diff)
downloadbinaryen-0ee15961e43e0282b014e4328458e065b6976ba7.tar.gz
binaryen-0ee15961e43e0282b014e4328458e065b6976ba7.tar.bz2
binaryen-0ee15961e43e0282b014e4328458e065b6976ba7.zip
Fix multi-memory + C API for MemoryGrow and MemorySize (#4953)
Those instructions need to know if the memory is 64-bit or not. We looked that up on the module globally, which is convenient, but in the C API this was actually a breaking change, it turns out. To keep things working, provide that information when creating a MemoryGrow or MemorySize, as another parameter in the C API. In the C++ API (wasm-builder), support both modes, and default to the automatic lookup. We already require a bunch of other explicit info when creating expressions, like making a Call requires the return type (we don't look it up globally), and even a LocalGet requires the local type (we don't look it up on the function), so this is consistent with those. Fixes #4946
Diffstat (limited to 'test')
-rw-r--r--test/example/c-api-kitchen-sink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/example/c-api-kitchen-sink.c b/test/example/c-api-kitchen-sink.c
index f6cee93fa..22f2d5f29 100644
--- a/test/example/c-api-kitchen-sink.c
+++ b/test/example/c-api-kitchen-sink.c
@@ -1034,8 +1034,8 @@ void test_core() {
BinaryenPop(module, BinaryenTypeExternref()),
BinaryenPop(module, iIfF),
// Memory
- BinaryenMemorySize(module, "0"),
- BinaryenMemoryGrow(module, makeInt32(module, 0), "0"),
+ BinaryenMemorySize(module, "0", false),
+ BinaryenMemoryGrow(module, makeInt32(module, 0), "0", false),
// GC
BinaryenI31New(module, makeInt32(module, 0)),
BinaryenI31Get(module, i31refExpr, 1),