summaryrefslogtreecommitdiff
path: root/src/ir/table-utils.h
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-04-08 18:06:15 -0700
committerGitHub <noreply@github.com>2021-04-08 18:06:15 -0700
commit8498027da4e078e6babe72f66829b479dd163510 (patch)
tree882048ce758b06d32c3875eb4d72d6574dfe1071 /src/ir/table-utils.h
parent8e20e49a858f207e689589dfe9c056098c58eca2 (diff)
downloadbinaryen-8498027da4e078e6babe72f66829b479dd163510.tar.gz
binaryen-8498027da4e078e6babe72f66829b479dd163510.tar.bz2
binaryen-8498027da4e078e6babe72f66829b479dd163510.zip
RefFunc: Validate that the type is non-nullable, and avoid possible bugs in the builder (#3790)
The builder can receive a HeapType so that callers don't need to set non-nullability themselves. Not NFC as some of the callers were in fact still making it nullable.
Diffstat (limited to 'src/ir/table-utils.h')
-rw-r--r--src/ir/table-utils.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ir/table-utils.h b/src/ir/table-utils.h
index d3151bd2c..d2f90626a 100644
--- a/src/ir/table-utils.h
+++ b/src/ir/table-utils.h
@@ -87,9 +87,7 @@ inline Index append(Table& table, Name name, Module& wasm) {
auto* func = wasm.getFunctionOrNull(name);
assert(func != nullptr && "Cannot append non-existing function to a table.");
- // FIXME: make the type NonNullable when we support it!
- auto type = Type(HeapType(func->sig), Nullable);
- segment->data.push_back(Builder(wasm).makeRefFunc(name, type));
+ segment->data.push_back(Builder(wasm).makeRefFunc(name, func->sig));
table.initial = table.initial + 1;
return tableIndex;
}