diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/binaryen-c.cpp | 4 | ||||
-rw-r--r-- | test/binaryen.js/expressions.js | 4 | ||||
-rw-r--r-- | test/binaryen.js/kitchen-sink.js.txt | 8 |
4 files changed, 9 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d79c1c0f8..876a96032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Current Trunk - Implemented bottom heap types: `none`, `nofunc`, and `noextern`. RefNull expressions and null `Literal`s must now have type `nullref`, `nullfuncref`, or `nullexternref`. +* The C-API's `BinaryenTypeI31ref` and `BinaryenTypeDataref` now return nullable types. v110 ---- diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index cd3806810..4501a67e0 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -197,10 +197,10 @@ BinaryenType BinaryenTypeEqref(void) { return Type(HeapType::eq, Nullable).getID(); } BinaryenType BinaryenTypeI31ref(void) { - return Type(HeapType::i31, NonNullable).getID(); + return Type(HeapType::i31, Nullable).getID(); } BinaryenType BinaryenTypeDataref(void) { - return Type(HeapType::data, NonNullable).getID(); + return Type(HeapType::data, Nullable).getID(); } BinaryenType BinaryenTypeArrayref(void) { return Type(HeapType::array, Nullable).getID(); diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js index 71846f3c6..c0bc402a0 100644 --- a/test/binaryen.js/expressions.js +++ b/test/binaryen.js/expressions.js @@ -1814,13 +1814,13 @@ console.log("# I31New"); assert(theI31New instanceof binaryen.I31New); assert(theI31New instanceof binaryen.Expression); assert(theI31New.value === value); - assert(theI31New.type === binaryen.i31ref); + // assert(theI31New.type === binaryen.?); // TODO: (ref i31) theI31New.value = value = module.local.get(2, binaryen.i32); assert(theI31New.value === value); theI31New.type = binaryen.f64; theI31New.finalize(); - assert(theI31New.type === binaryen.i31ref); + // assert(theI31New.type === binaryen.?); // TODO: (ref i31) console.log(theI31New.toText()); assert( diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt index 104405c8a..89c49f2d5 100644 --- a/test/binaryen.js/kitchen-sink.js.txt +++ b/test/binaryen.js/kitchen-sink.js.txt @@ -2176,10 +2176,10 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (pop eqref) ) (drop - (pop (ref i31)) + (pop i31ref) ) (drop - (pop (ref data)) + (pop dataref) ) (drop (pop stringref) @@ -4280,10 +4280,10 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7} (pop eqref) ) (drop - (pop (ref i31)) + (pop i31ref) ) (drop - (pop (ref data)) + (pop dataref) ) (drop (pop stringref) |