summaryrefslogtreecommitdiff
path: root/src/ir/possible-contents.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/possible-contents.cpp')
-rw-r--r--src/ir/possible-contents.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ir/possible-contents.cpp b/src/ir/possible-contents.cpp
index 8349939e1..cd8bd1516 100644
--- a/src/ir/possible-contents.cpp
+++ b/src/ir/possible-contents.cpp
@@ -195,11 +195,17 @@ void PossibleContents::intersectWithFullCone(const PossibleContents& other) {
}
// If the heap types are not compatible then they are in separate hierarchies
- // and there is no intersection.
+ // and there is no intersection, aside from possibly a null of the bottom
+ // type.
auto isSubType = HeapType::isSubType(heapType, otherHeapType);
auto otherIsSubType = HeapType::isSubType(otherHeapType, heapType);
if (!isSubType && !otherIsSubType) {
- value = None();
+ if (nullability == Nullable &&
+ heapType.getBottom() == otherHeapType.getBottom()) {
+ value = Literal::makeNull(heapType.getBottom());
+ } else {
+ value = None();
+ }
return;
}