summaryrefslogtreecommitdiff
path: root/src/passes/GUFA.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/passes/GUFA.cpp')
-rw-r--r--src/passes/GUFA.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/passes/GUFA.cpp b/src/passes/GUFA.cpp
index 4250c76e9..137ffda17 100644
--- a/src/passes/GUFA.cpp
+++ b/src/passes/GUFA.cpp
@@ -237,10 +237,8 @@ struct GUFAOptimizer
if (refType.isRef()) {
// We have some knowledge of the type here. Use that to optimize: RefTest
// returns 1 if the input is of a subtype of the intended type, that is,
- // we are looking for a type in that cone of types. (Note that we use a
- // non-nullable cone since only a non-null can pass the test.)
- auto intendedContents =
- PossibleContents::fullConeType(Type(curr->intendedType, NonNullable));
+ // we are looking for a type in that cone of types.
+ auto intendedContents = PossibleContents::fullConeType(curr->castType);
auto optimize = [&](int32_t result) {
auto* last = Builder(*getModule()).makeConst(Literal(int32_t(result)));