diff options
author | 2022-01-22 20:06:18 -0800 | |
---|---|---|
committer | 2022-01-22 20:06:18 -0800 | |
commit | 4b7235ac5f12b571de8ca8943e2019f235d8c5c4 (patch) | |
tree | 6a35625441917e8d76566eb86d2fafd31bd8b0dd | |
parent | 4152c1b17738db98e9b05c7ebdee5c3bb8e18e2d (diff) | |
download | bun-4b7235ac5f12b571de8ca8943e2019f235d8c5c4.tar.gz bun-4b7235ac5f12b571de8ca8943e2019f235d8c5c4.tar.zst bun-4b7235ac5f12b571de8ca8943e2019f235d8c5c4.zip |
Update helpers.h
-rw-r--r-- | src/javascript/jsc/bindings/helpers.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/javascript/jsc/bindings/helpers.h b/src/javascript/jsc/bindings/helpers.h index d88d0cfde..fb499ddcf 100644 --- a/src/javascript/jsc/bindings/helpers.h +++ b/src/javascript/jsc/bindings/helpers.h @@ -70,7 +70,11 @@ namespace Zig { // we tag the final two bits // so 56 bits are copied over // rest we zero out for consistentcy -static const unsigned char *untag(const unsigned char *ptr) { return ptr; } +static const unsigned char *untag(const unsigned char *ptr) { + return reinterpret_cast<const unsigned char *>( + ((reinterpret_cast<uintptr_t>(ptr) & (static_cast<uint64_t>(1) << 63) & + (static_cast<uint64_t>(1) << 62)))); +} static const JSC::Identifier toIdentifier(ZigString str, JSC::JSGlobalObject *global) { if (str.len == 0 || str.ptr == nullptr) { return JSC::Identifier::EmptyIdentifier; } |