#include <stdio.h>
#include <setjmp.h>
jmp_buf jb;
void some_func (void)
{
register int a = 1;
a = 7;
// do something
printf("a = %d (initialized)\n", a
);
// use longjmp to make `a` not initialized
// NOTREACHED
} else {
printf("a = %d (not initialized)\n", a
); }
}
int main (void)
{
some_func();
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzZXRqbXAuaD4KCmptcF9idWYgamI7Cgp2b2lkIHNvbWVfZnVuYyAodm9pZCkKewogICAgcmVnaXN0ZXIgaW50IGEgPSAxOwoKICAgIGlmIChzZXRqbXAoamIpID09IDApIHsKICAgICAgICBhID0gNzsKCiAgICAgICAgLy8gZG8gc29tZXRoaW5nCiAgICAgICAgcHJpbnRmKCJhID0gJWQgKGluaXRpYWxpemVkKVxuIiwgYSk7CgogICAgICAgIC8vIHVzZSBsb25nam1wIHRvIG1ha2UgYGFgIG5vdCBpbml0aWFsaXplZAogICAgICAgIGxvbmdqbXAoamIsIDEpOwogICAgICAgIC8vIE5PVFJFQUNIRUQKICAgIH0gZWxzZSB7CiAgICAgICAgcHJpbnRmKCJhID0gJWQgKG5vdCBpbml0aWFsaXplZClcbiIsIGEpOwogICAgfQp9CgppbnQgbWFpbiAodm9pZCkKewogICAgc29tZV9mdW5jKCk7CiAgICByZXR1cm4gMDsKfQo=