summaryrefslogtreecommitdiff
path: root/src/ir/possible-contents.cpp
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2022-08-01 13:35:18 -0700
committerGitHub <noreply@github.com>2022-08-01 13:35:18 -0700
commit0b288693cc74810278af9c4630fdb0d5fa7dd7bd (patch)
treeeec12469a6981c1d666ed1ca85221202f306de8e /src/ir/possible-contents.cpp
parent67459642f1d3cfdb74190a83aa1228cfa7332ecd (diff)
downloadbinaryen-0b288693cc74810278af9c4630fdb0d5fa7dd7bd.tar.gz
binaryen-0b288693cc74810278af9c4630fdb0d5fa7dd7bd.tar.bz2
binaryen-0b288693cc74810278af9c4630fdb0d5fa7dd7bd.zip
Update reference type Literal constructors to use HeapType (#4857)
We already require non-null literals to have non-null types, but with this change we can enforce that constraint by construction. Also remove the default behavior of creating a function reference literal with heap type `func`, since there is always a more specific function type to use.
Diffstat (limited to 'src/ir/possible-contents.cpp')
-rw-r--r--src/ir/possible-contents.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index 67891f45f..ab0d379f6 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -360,7 +360,9 @@ struct InfoCollector
addRoot(curr);
}
void visitRefFunc(RefFunc* curr) {
- addRoot(curr, PossibleContents::literal(Literal(curr->func, curr->type)));
+ addRoot(
+ curr,
+ PossibleContents::literal(Literal(curr->func, curr->type.getHeapType())));
}
void visitRefEq(RefEq* curr) {
// TODO: optimize when possible (e.g. when both sides must contain the same