Pike uses longjmp and setjmp to implement the exception system.
Pike_error does a longjmp to the first item in the error recovery list, that beeing the last place anyone did SETJMP (equivalent to catch in this context).
It then removes the item from the list.
There is also a list of functions that should be called when an error is encoutered (the *ONERROR macros in pike_error.h), those are called to clean up resources allocated but not yet anchored in any pike structures.
/ Per Hedbor ()
Previous text:
2004-10-15 14:11: Subject: longjmps in pike
While looking at the code in dbg_main(), I saw that pike uses longjmps. I suspect the use for this is the exception handling stuff. Am I on the right track?
Can someone elaborate a bit on the usage as to where it is used in pike and how things are supposed to interact..?
/ Marcus Agehall (PacketFront)