Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Improve handling of $! in exception logic #315
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: