Skip to content
New issue

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

Macro definition error:JS_VALUE_IS_BOTH_INT in quickjs.h? #82

Closed
J5ive opened this issue Jul 25, 2021 · 1 comment
Closed

Macro definition error:JS_VALUE_IS_BOTH_INT in quickjs.h? #82

J5ive opened this issue Jul 25, 2021 · 1 comment

Comments

@J5ive
Copy link

J5ive commented Jul 25, 2021

line 247 in quickjs.h:
#define JS_VALUE_IS_BOTH_INT(v1, v2) ((JS_VALUE_GET_TAG(v1) | JS_VALUE_GET_TAG(v2)) == 0)

It seems not right in JS_STRICT_NAN_BOXING mode, because JS_TAG_INT is 1, not 0.
It will not cause wrong results, but will cause slow operation.
It should be:
#define JS_VALUE_IS_BOTH_INT(v1, v2) ((JS_VALUE_GET_TAG(v1) | JS_VALUE_GET_TAG(v2)) == 1)

@J5ive J5ive closed this as completed Jul 25, 2021
@heroboy
Copy link

heroboy commented Jul 8, 2024

why close?
I have the same question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants