We are modifying it after setjmp and then accessing it after the jump, so it cannot be a local.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
I agree with the analysis, but the variables should still be defined inside main (with static) so they cannot be used outside. Some of the other functions in this file have their own smark locals that should not be mixed up with main's.
An alternative fix could be to change setstackmark and popstackmark to return/take the struct stackmark by value and make main's variables volatile. I'm not really sure that's better than just adding the static keyword though.