We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When passing INT64_MIN to bf_set_si I experience a sigtrap on my system. I believe this is due to undefined behavior on this line:
bf_set_si
quickjs/libbf.c
Line 274 in 6e2e68f
as this will attempt to negate INT64_MIN
INT64_MIN
Might need a special case, possibly something like this:
int bf_set_si(bf_t *r, int64_t a) { int ret; // Special case as -INT64_MIN is undefined if (a == INT64_MIN) { ret = bf_set_ui(r, (uint64_t)INT64_MAX + 1); r->sign = 1; } else if (a < 0) { ret = bf_set_ui(r, -a); r->sign = 1; } else { ret = bf_set_ui(r, a); } return ret; }
The text was updated successfully, but these errors were encountered:
Upstream libbf has an undefined behavior bug in bf_set_si. This provi…
370c783
…des a fix. See also bellard/quickjs#358
Changing to bf_set_ui(r, -(uint64_t)a) would be simpler.
bf_set_ui(r, -(uint64_t)a)
Sorry, something went wrong.
No branches or pull requests
When passing INT64_MIN to
bf_set_si
I experience a sigtrap on my system. I believe this is due to undefined behavior on this line:quickjs/libbf.c
Line 274 in 6e2e68f
as this will attempt to negate
INT64_MIN
Might need a special case, possibly something like this:
The text was updated successfully, but these errors were encountered: