Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix a corner case with (if ...) merge points.

  • Loading branch information...
commit 3d3abd1f85c7ae09008e0abda6ef1ed7e8d27cee 1 parent 6271769
@whitequark authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/furnace-avm2/transform/cfg_reduce.rb
View
8 lib/furnace-avm2/transform/cfg_reduce.rb
@@ -472,9 +472,11 @@ def extended_block(block, stopgap=nil, loop_stack=[], nesting=0, upper_exc=nil,
if completely_dominated?(right_root, block)
# Yes. Find merge point.
- # The function technically finds two merge points,
- # but in case of two heads they're identical.
- merge, = find_merge_point([ left_root, right_root ])
+ merge_left, merge_right = find_merge_point([ left_root, right_root ])
+
+ # One or both of the merge points could be nil, but they will
+ # not be different.
+ merge = merge_left || merge_right
# If the merge search did not yield a valid node, use
# stopgap for the current block to avoid runaway code
Please sign in to comment.
Something went wrong with that request. Please try again.