mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
LibC: Check for expected size of struct __jmp_buf
This structure is accessed through assembly code inside setjmp.S, make some effort to ensure both header and assembly files are in sync.
This commit is contained in:
parent
295e89af04
commit
0248e6ae27
Notes:
sideshowbarker
2024-07-18 05:17:26 +09:00
Author: https://github.com/boricj Commit: https://github.com/SerenityOS/serenity/commit/0248e6ae279 Pull-request: https://github.com/SerenityOS/serenity/pull/9604
1 changed files with 8 additions and 0 deletions
|
@ -45,6 +45,14 @@ struct __jmp_buf {
|
|||
typedef struct __jmp_buf jmp_buf[1];
|
||||
typedef struct __jmp_buf sigjmp_buf[1];
|
||||
|
||||
#ifdef __i386__
|
||||
static_assert(sizeof(struct __jmp_buf) == 32, "struct __jmp_buf unsynchronized with i386/setjmp.S");
|
||||
#elif __x86_64__
|
||||
static_assert(sizeof(struct __jmp_buf) == 72, "struct __jmp_buf unsynchronized with x86_64/setjmp.S");
|
||||
#else
|
||||
# error
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Calling conventions mandates that sigsetjmp() cannot call setjmp(),
|
||||
* otherwise the restored calling environment will not be the original caller's
|
||||
|
|
Loading…
Add table
Reference in a new issue