summaryrefslogtreecommitdiff
path: root/src/wasm/wasm.cpp
diff options
context:
space:
mode:
authorMax Graey <maxgraey@gmail.com>2021-10-07 22:43:30 +0300
committerGitHub <noreply@github.com>2021-10-07 12:43:30 -0700
commit2dff27c086e8f2a9913096ebf3dc93e97051d85a (patch)
tree3d689a659ad2339639fc4b2e73753b51e6d9295c /src/wasm/wasm.cpp
parentff68bca64cd669aff59c7e1cc0a6677d267a410f (diff)
downloadbinaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.tar.gz
binaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.tar.bz2
binaryen-2dff27c086e8f2a9913096ebf3dc93e97051d85a.zip
Add table.set operation (#4215)
Diffstat (limited to 'src/wasm/wasm.cpp')
-rw-r--r--src/wasm/wasm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp
index 19ba5f265..26e6b369b 100644
--- a/src/wasm/wasm.cpp
+++ b/src/wasm/wasm.cpp
@@ -825,6 +825,14 @@ void TableGet::finalize() {
// Otherwise, the type should have been set already.
}
+void TableSet::finalize() {
+ if (index->type == Type::unreachable || value->type == Type::unreachable) {
+ type = Type::unreachable;
+ } else {
+ type = Type::none;
+ }
+}
+
void Try::finalize() {
// If none of the component bodies' type is a supertype of the others, assume
// the current type is already correct. TODO: Calculate a proper LUB.