summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-08-26 12:18:40 -0700
committerGitHub <noreply@github.com>2022-08-26 12:18:40 -0700
commitc0463f1dd090e6524090076e2a2e4b435c87ebd7 (patch)
treee585f01406d0ac8a6cbbe554a251fd9c03b501a2 /src/wasm/wasm-binary.cpp
parent9d20a4e129dc6666f873d84566ea504dfc46ccdc (diff)
downloadbinaryen-c0463f1dd090e6524090076e2a2e4b435c87ebd7.tar.gz
binaryen-c0463f1dd090e6524090076e2a2e4b435c87ebd7.tar.bz2
binaryen-c0463f1dd090e6524090076e2a2e4b435c87ebd7.zip
Emit `i31ref` and `dataref` binary shorthands (#4844)
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index 685ad978d..64464fde5 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -1409,13 +1409,11 @@ void WasmBinaryWriter::writeType(Type type) {
o << S32LEB(BinaryConsts::EncodedType::eqref);
return;
case HeapType::i31:
- // TODO: Emit i31ref once V8 (and Binaryen itself) treats it as
- // nullable.
- break;
+ o << S32LEB(BinaryConsts::EncodedType::i31ref);
+ return;
case HeapType::data:
- // TODO: Emit dataref once V8 (and Binaryen itself) treats it as
- // nullable.
- break;
+ o << S32LEB(BinaryConsts::EncodedType::dataref);
+ return;
case HeapType::string:
o << S32LEB(BinaryConsts::EncodedType::stringref);
return;