-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When including setjmp.h and declaring a global variable with type jmp_buf, the generated insight is just std::jmp_buf = std::jmp_buf.
Example source code (line 3):
#include <cstdio>
#include <csetjmp>
std::jmp_buf jump_buffer;
void foo() {
printf("foo: Entered\n");
longjmp(jump_buffer, 1); // Jump back to where setjmp was called
printf("foo: This won't be executed\n");
}
int main() {
if (setjmp(jump_buffer) == 0) {
printf("main: Calling foo\n");
foo();
} else {
printf("main: Jumped back from foo\n");
}
printf("main: Exiting\n");
return 0;
}Generated insight (line 3):
#include <cstdio>
#include <csetjmp>
std::jmp_buf = std::jmp_buf();
void foo()
{
printf("foo: Entered\n");
longjmp(jump_buffer, 1);
printf("foo: This won't be executed\n");
}
int main()
{
if(_setjmp(jump_buffer) == 0) {
printf("main: Calling foo\n");
foo();
} else {
printf("main: Jumped back from foo\n");
}
printf("main: Exiting\n");
return 0;
}Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working