MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / stack_manipulate_func

Function stack_manipulate_func

test/core/test_longjmp2.c:15–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13} jmp_state;
14
15void stack_manipulate_func(jmp_state* s, int level) {
16 jmp_buf buf;
17
18 printf("Entering stack_manipulate_func, level: %d\n", level);
19
20 if (level == 0) {
21 s->jmp = &buf;
22 if (setjmp(*(s->jmp)) == 0) {
23 printf("Setjmp normal execution path, level: %d\n", level);
24 stack_manipulate_func(s, level + 1);
25 } else {
26 printf("Setjmp error execution path, level: %d\n", level);
27 }
28 } else {
29 printf("Perform longjmp at level %d\n", level);
30 longjmp(*(s->jmp), 1);
31 }
32
33 printf("Exiting stack_manipulate_func, level: %d\n", level);
34}
35
36int main(int argc, char* argv[]) {
37 jmp_state s;

Callers 1

mainFunction · 0.85

Calls 1

printfFunction · 0.85

Tested by

no test coverage detected