...
Code Block | ||||
---|---|---|---|---|
| ||||
#include <csetjmp> #include <iostream> static jmp_buf env; struct Counter { static int Instances; Counter() { ++Instances; } ~Counter() { --Instances; } }; int Counter::Instances = 0; void f() { Counter c; std::cout << "f(): Instances: " << Counter::Instances << std::endl; std::longjmp(env, 1); } int main() { std::cout << "Before setjmp(): Instances: " << Counter::Instances << std::endl; if (setjmp(env) == 0) { f(); } else { std::cout << "From longjmp(): Instances: " << Counter::Instances << std::endl; } std::cout << "After longjmp(): Instances: " << Counter::Instances << std::endl; } |
...
Tool | Version | Checker | Description | ||||||
| Secondary Analysis |
Related Vulnerabilities
...