-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
napi_check_object_type_tag
returns false if upper
in napi_type_tag
is 0
#43786
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Labels
node-api
Issues and PRs related to the Node-API.
Comments
static const napi_type_tag MyTypeTag = {
0x0, 0xa5ed9ce2e4c00c38
}; I guess you meant node/src/js_native_api_types.h Lines 160 to 163 in 5fad0b9
|
@daeyeon Good catch; that's correct. I was transcribing from Rust and my test code used named fields. |
guangwong
pushed a commit
to noslate-project/node
that referenced
this issue
Oct 10, 2022
This fixes a comparison failure occurring when the upper value of a type tag is 0, or a type tag value is 0. Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com PR-URL: nodejs/node#43788 Fixes: nodejs/node#43786 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Uh oh!
There was an error while loading. Please reload this page.
Version
All version supporting Node-API 8+
Platform
All
Subsystem
Node-API
What steps will reproduce the bug?
Create a type tag with an
upper
value of0
.Tag an object with it:
Check the type tag:
How often does it reproduce? Is there a required condition?
100% of the time
What is the expected behavior?
napi_check_object_type_tag
will setis_my_type
totrue
.What do you see instead?
is_my_type
remainsfalse
.Additional information
Type tags are stored in a
BigInt
. Ifupper
is0
, then the leading zero gets truncated and the length is1
. However, the follow check expects the length to always be2
.node/src/js_native_api_v8.cc
Line 2455 in 5fad0b9
This could could be something like:
The text was updated successfully, but these errors were encountered: