diff options
Diffstat (limited to 'src/ir')
-rw-r--r-- | src/ir/possible-constant.h | 10 | ||||
-rw-r--r-- | src/ir/possible-contents.cpp | 8 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/ir/possible-constant.h b/src/ir/possible-constant.h index b3272461d..21f1cfa65 100644 --- a/src/ir/possible-constant.h +++ b/src/ir/possible-constant.h @@ -114,8 +114,14 @@ public: auto type = getConstantLiteral().type.getHeapType(); auto otherType = other.getConstantLiteral().type.getHeapType(); auto lub = HeapType::getLeastUpperBound(type, otherType); - if (lub != type) { - value = Literal::makeNull(lub); + if (!lub) { + // TODO: Remove this workaround once we have bottom types to assign to + // null literals. + value = Many(); + return true; + } + if (*lub != type) { + value = Literal::makeNull(*lub); return true; } return false; diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp index 7079a9446..d9c608bda 100644 --- a/src/ir/possible-contents.cpp +++ b/src/ir/possible-contents.cpp @@ -56,7 +56,13 @@ void PossibleContents::combine(const PossibleContents& other) { assert(other.isNull()); auto lub = HeapType::getLeastUpperBound(type.getHeapType(), otherType.getHeapType()); - value = Literal::makeNull(lub); + if (!lub) { + // TODO: Remove this workaround once we have bottom types to assign to + // null literals. + value = Many(); + return; + } + value = Literal::makeNull(*lub); } return; } |