On Jan 5, 2006, at 3:26, Bob Rogers wrote:

   This patch fixes two find_exception_handler bugs, and identifies a
third, all related to executing pushaction subs:

Applied - r10902

   1.  It is necessary to wait until after popping the action before
calling it, lest the signalling of another error during action execution
causes you to lose, and lose, and lose, . . .

Good catch.


   2.  Even without an error, it seems that actions could sometimes be
run twice because stack_pop compared entry->cleanup to 0 instead of
STACK_CLEANUP_NULL.  (I can't reproduce this now, so it probably
depended on something else as well.)

Well, STACK_CLEANUP_NULL is ((Stack_cleanup_method)NULLfunc), which is the same as 0 on all current platforms (AFAIK), but your patch is of course correct.

3. Actions are not run at all if the context is skipped by calling a
continuation.  This is a deeper problem, so I've just added a TODO test
in order to document it as a known problem; I hope to fix this in the
course of implementing dynamic binding.

It should work, when implementing the stack unwinding in Continuation.invoke (which is also called by Exception_handler.invoke). Now the question arises: what to do on the 2nd time the sub is running. There are probably 2 options: a) user code has to reenable exception handlers and cleanup actions, i.e. above stack unwinding is permanent b) the control stack remains unchanged, all exception handlers and cleanup actions are still in place.

   TIA,

I thank you,
leo

Reply via email to