On Thursday 01 May 2003 01:42 am, Ove Kaaven wrote:
tor, 01.05.2003 kl. 07.26 skrev Gregory M. Turner:
(b) if the exception code doesn't run, A() runs longjmp again, to non-local goto /back/ into D(), using the second jmp_buf. This returns normally and would, I guess, expect to unwind the stack normally through C(), B() and so on... (this is all ignoring the fact that flow-of-control was interrupted by an exception, but for my purposes I don't think it matters).
This is not OK. Since the first setjmp releases all the stack frames between A and D, trying to later reclaim that released stack with another setjmp is doomed to unpredictable stack corruption.
was afraid of that... bummer. well, back to the drawing board ;) I guess this is how we ended up with the need for a function in the first place -- you (seem to) need "lambda" delayed execution capabilities that aren't easily achieved by a macro... :( Say, Alexandre, would it be a possibility to just bake some magic into wpp for this? -- "Security is mostly superstition. It does not exist in nature, nor do the children of men as a whole experience it. Avoiding danger is no safer in the long run than outright exposure. Life is either a daring adventure, or nothing. To keep our faces toward change and behave like free spirits in the presence of fate is strength undefeatable." --Helen Keller gmt