diff options
| author | Jakob Kaivo <jkk@ung.org> | 2024-01-30 22:33:30 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2024-01-30 22:33:30 -0500 |
| commit | 50ff0c0c5b6b1e3b89967f679b1edf78788494b7 (patch) | |
| tree | d5d01f2990a186f3389dc634594ac8720a8f688e /src/setjmp | |
| parent | afb77ecfbce74bdd61b607b84f6b967898e7787f (diff) | |
update to 1:1 checked functions
Diffstat (limited to 'src/setjmp')
| -rw-r--r-- | src/setjmp/__longjmp.x86-64.s | 4 | ||||
| -rw-r--r-- | src/setjmp/__setjmp.x86-64.s | 4 | ||||
| -rw-r--r-- | src/setjmp/longjmp.c | 6 | ||||
| -rw-r--r-- | src/setjmp/setjmp.c | 6 |
4 files changed, 12 insertions, 8 deletions
diff --git a/src/setjmp/__longjmp.x86-64.s b/src/setjmp/__longjmp.x86-64.s index de666dce..b62f5879 100644 --- a/src/setjmp/__longjmp.x86-64.s +++ b/src/setjmp/__longjmp.x86-64.s @@ -1,5 +1,5 @@ -.global __longjmp -__longjmp: +.global ___longjmp +___longjmp: mov %rdi, %rax mov 0x08(%rax), %rbx mov 0x18(%rax), %rdx diff --git a/src/setjmp/__setjmp.x86-64.s b/src/setjmp/__setjmp.x86-64.s index d5b095e1..00b139b1 100644 --- a/src/setjmp/__setjmp.x86-64.s +++ b/src/setjmp/__setjmp.x86-64.s @@ -1,5 +1,5 @@ -.global __setjmp -__setjmp: +.global ___setjmp +___setjmp: /* setjmp() in C sets env[0] to 0 */ mov %rbx, 0x08(%rdi) mov %rcx, 0x10(%rdi) diff --git a/src/setjmp/longjmp.c b/src/setjmp/longjmp.c index 26c65299..c9ea0d28 100644 --- a/src/setjmp/longjmp.c +++ b/src/setjmp/longjmp.c @@ -5,17 +5,19 @@ _Noreturn void longjmp(jmp_buf env, int val) { - extern _Noreturn void __longjmp(jmp_buf); + extern _Noreturn void ___longjmp(jmp_buf); SIGNAL_SAFE(0); /* use val if nonzero, otherwise 1 */ env[0] = val ? val : 1; for (;;) { - __longjmp(env); + ___longjmp(env); } } +__vcheck_2(longjmp, jmp_buf, int) + /*** restores the environment of a previous call to FUNCTION(setjmp) and continues execution at the location of the call to FUNCTION(setjmp). diff --git a/src/setjmp/setjmp.c b/src/setjmp/setjmp.c index 093bd7c5..02b95789 100644 --- a/src/setjmp/setjmp.c +++ b/src/setjmp/setjmp.c @@ -6,12 +6,14 @@ int setjmp(jmp_buf env) { - extern int __setjmp(jmp_buf); + extern int ___setjmp(jmp_buf); SIGNAL_SAFE(0); memset(env, 0, sizeof(jmp_buf)); - return __setjmp(env); + return ___setjmp(env); } +__check_1(int, 0, setjmp, jmp_buf) + /*** saves the current state of the calling environment in the TYPEDEF(jmp_buf) ARGUMENT(env). |
