Skip to content

[BOX64] error on test siglongjump #3274

@luoqiaoling

Description

@luoqiaoling

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions