box64 icon indicating copy to clipboard operation
box64 copied to clipboard

[BOX64] error on test siglongjump

Open luoqiaoling opened this issue 1 month ago • 1 comments

Hi ptitSeb, I found an issue in the my_longjmp​ function in the file src/wrapped/wrappedlibc.cin box64. The correct fix is as follows:

Change:

R_RAX = __val;

to:

if (__val == 0) { R_RAX = 1; } else { R_RAX = __val; }

test case for verification:

#include <stdio.h> #include <setjmp.h>

sigjmp_buf env;

int main() { int r = sigsetjmp(env, 1); if (r == 0) { printf("first\n"); siglongjmp(env, 0); } else { printf("second %d\n", r); } return 0; }

luoqiaoling avatar Dec 15 '25 04:12 luoqiaoling

Ah indeed, I'll fix that thanks.

ptitSeb avatar Dec 15 '25 07:12 ptitSeb