forked from rubinius/rubinius
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle control flow edge case in JIT. Fixes rubinius#478.
See the crash test committed. The bug as because if the instruction after a git/gif was a loop header, we wouldn't set the exception handler of the loop body block.
- Loading branch information
Evan Phoenix
committed
Sep 21, 2010
1 parent
96a6d91
commit 82f2b57
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Test for a JIT bug where the while inside the if generated a goto | ||
# of a loop header and skipped setup up the exception handler | ||
# properly. | ||
# | ||
# If this doesn't crash, the bug is fixed. | ||
def bad | ||
i = 0 | ||
begin | ||
if i < 10 | ||
while i < 20 | ||
i += 2 | ||
end | ||
end | ||
rescue => ex | ||
raise "failure is an option" | ||
end | ||
i | ||
end | ||
|
||
1000000.times do | ||
bad | ||
end |