Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Improve handling of $! in exception logic #315

headius opened this Issue · 0 comments

1 participant


For #311, @subbuss wrote the following comment, which describes the work needed for this issue:

The reason -X+C doesn't have this bug is because I did not clean up the JIT to remove the $! hack as I did with -X-CIR and -X-C (See commit log note in 7c3f642). Curious why this example doesn't fail in -X-CIR mode since IR doesn't have the $! hack either. I do know that in IR mode, $! is saved and restored properly in IR-generated code, so maybe the clobbering in the runtime does not matter ... but just a guess.

The bigger issue that this bug exposes is that "$!" is a proxy for the errorInfo value in ThreadContext and so, $! can be modified indirectly by directly calling setErrorInfo. Ideally, in later commits, we should do the following:

  • clean up the JIT to get rid of the $! hack as done for the AST interp in 20632af
  • audit all uses of setErrorInfo to see if they clobber $! accidentally anywhere else.
  • unify the globalVariables.set("$!", foo) and setErrorInfo(foo) paths so that we use one or the other uniformly, if feasible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.