Turning a SIGSEGV into a regular function call under Linux, allowing throw

Vladimir Panteleev vladimir at thecybershadow.net
Wed Mar 14 09:34:41 PDT 2012


On Wednesday, 14 March 2012 at 07:35:50 UTC, FeepingCreature 
wrote:
> Sweet. Yeah, I think you need to use naked and reconstruct the 
> stackframe. Not sure how it'd look; I'm not familiar with the 
> x86_64 ABI.

I think it might be safe to just reconstruct the stack frame in 
the signal handler, and set gregs[REG_EIP] to &_d_throw directly. 
It should also use a pre-allocated exception object (like how 
it's done with OutofMemoryError and InvalidMemoryOperationError), 
in case there's data corruption in the GC.


More information about the Digitalmars-d mailing list