diff --git a/libc/setjmp/setjmp.c b/libc/setjmp/setjmp.c index 4c58aa0..05b5a39 100644 --- a/libc/setjmp/setjmp.c +++ b/libc/setjmp/setjmp.c @@ -5,6 +5,7 @@ int setjmp(jmp_buf env) { "mov %%ebp, %0\n" // Save BP "mov %%esp, %1\n" // Save SP "call 1f\n" // Call label to push PC to the stack + "1:\n" // Label to jump "pop %2\n" // Save PC : "=m"(env._bp), "=m"(env._sp), "=m"(env._pc) // Locations ); @@ -12,7 +13,7 @@ int setjmp(jmp_buf env) { } void longjmp(jmp_buf env, int value) { - if (val == 0) return; + if (value == 0) return; __asm__ volatile ( "mov %0, %%ebp\n" // Restore BP diff --git a/todo.txt b/todo.txt index 0b1f0ca..47f1b53 100644 --- a/todo.txt +++ b/todo.txt @@ -38,8 +38,7 @@ Legend: - [x] errno.h - [ ] float.h - [x] limits.h - - [ ] math.h - - [ ] tgmath.h (if we want type generic) + - [x] math.h (maybe a separate libm?) TODO: add errno errors in there - [x] setjmp.h (this plagues my mind) - [ ] signal.h (we would need signals first) - [x] stdarg.h