From 0b288693cc74810278af9c4630fdb0d5fa7dd7bd Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Mon, 1 Aug 2022 13:35:18 -0700 Subject: 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. --- src/ir/possible-contents.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ir/possible-contents.cpp') 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 -- cgit v1.2.3