diff options
Diffstat (limited to 'src/ir/ReFinalize.cpp')
-rw-r--r-- | src/ir/ReFinalize.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ir/ReFinalize.cpp b/src/ir/ReFinalize.cpp index 947f9d975..0f7bab653 100644 --- a/src/ir/ReFinalize.cpp +++ b/src/ir/ReFinalize.cpp @@ -50,8 +50,9 @@ void ReFinalize::visitBlock(Block* curr) { // Set the type to be a supertype of the branch types and the flowed-out // type. TODO: calculate proper LUBs to compute a new correct type in this // situation. - iter->second.insert(curr->list.back()->type); - Type::ensureSuperType(iter->second, curr->type); + auto& types = iter->second; + types.insert(curr->list.back()->type); + curr->type = Type::getLeastUpperBound(types); return; } } |