Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rescue optimization over-optimizes rescue body with $! #4240

Closed
headius opened this issue Oct 21, 2016 · 0 comments
Closed

Rescue optimization over-optimizes rescue body with $! #4240

headius opened this issue Oct 21, 2016 · 0 comments
Labels
Milestone

Comments

@headius
Copy link
Member

headius commented Oct 21, 2016

Environment

Probably all JRuby releases since we started optimizing trivial rescues.

Expected Behavior

The exception in the following code should have a proper backtrace and not blow up in backtrace_locations.

$ jruby -e 'exception = (1 / 0) rescue $!; exception.backtrace_locations'
Unhandled Java exception: java.lang.NullPointerException
java.lang.NullPointerException: null
               backtrace_locations at org/jruby/RubyException.java:111

Actual Behavior

It doesn't have a backtrace and it blows up. $! is not being treated as an escape condition for the exception.

@enebo enebo added this to the JRuby 9.1.6.0 milestone Oct 21, 2016
@enebo enebo added the ir label Oct 21, 2016
@enebo enebo closed this as completed in bc7c127 Oct 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants