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

magic needs a tighter type specification #152

Closed
swimmadude66 opened this issue Dec 26, 2022 · 1 comment
Closed

magic needs a tighter type specification #152

swimmadude66 opened this issue Dec 26, 2022 · 1 comment

Comments

@swimmadude66
Copy link

the magic value is typed as an int everywhere, rather than something more specific. This causes the downstream library quickjs-emscripten to have a bug where reading the value returns a wrapped negative 16-bit integer . If it wouldn't break anything else, we were able to fully address this issue by simply re-typing magic to uint32_t everywhere.

Does this raise any eyebrows? My exposure to this library is only through quickjs-emscripten, so I don't know of the implications of this change on other usecases.

TooTallNate pushed a commit to TooTallNate/quickjs that referenced this issue Dec 18, 2023
Change JS_WriteObject() and JS_WriteObject2() to write little-endian
data and update JS_ReadObject() to byte-swap data when running on a
big-endian system.

Obsoletes the JS_WRITE_OBJ_BSWAP flag, it is now a no-op.

Fixes: quickjs-ng/quickjs#125
@bellard
Copy link
Owner

bellard commented Dec 27, 2023

I don't see any problem with that.

@bellard bellard closed this as completed Dec 27, 2023
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