If (a) you change local (stack) variables within your Try block, and (b) wish to make use of the updated values after an exception is thrown, those variables should be made volatile.
Is a little cryptic without an example for context. It seems to assume slightly more intimate knowledge of setjmp and longjmp.
More specifically, when you refer to stack variables, do you mean stack variables declared anywhere that make their way into a Try block. Does this include stack-allocated variables up the call tree?
Take for example:
void func(int *a)
{
// ...
int b = 0;
Try {
*a += 2;
b = *a;
Throw(MY_EX);
} Catch(e) {
// ...
}
printf("%d ?= %d", a, b);
}
void main()
{
int x = 1;
func(&x);
printf("%d", x);
}
Are both a and b at risk here? Is x (the stack memory a points to) at risk?
In the
README.md
the rule:Is a little cryptic without an example for context. It seems to assume slightly more intimate knowledge of
setjmp
andlongjmp
.More specifically, when you refer to stack variables, do you mean stack variables declared anywhere that make their way into a
Try
block. Does this include stack-allocated variables up the call tree?Take for example:
Are both
a
andb
at risk here? Isx
(the stack memorya
points to) at risk?