-
Notifications
You must be signed in to change notification settings - Fork 3.5k
makeGetValue - return type BigInt if WASM_BIGINT=1 and 64-bit type is specified (ex. "getValue(..., i64))" #16890
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
base: main
Are you sure you want to change the base?
Conversation
… specified (ex. "getValue(..., i64))"
|
I'm curious to see if all the test pass.. one alternative would be to opt into BigInt specifically by asking for |
|
BTW it looks like we only have a single internal user of makeGetValue with i64: Do you have external usage? |
|
I agree, making the user explicitly ask for 'bigint' can be a good alternative. I'm not sure if there is currently a good way to extract larger-than-52-bit values ( Not sure what is meant by "internal". My interest is in making these two lines from emscripten/src/runtime_safe_heap.js Line 59 in ebc4ac7
emscripten/src/runtime_safe_heap.js Line 73 in ebc4ac7
|
Are you calling |
|
Not exactly my code, but yes 🙂 |
Interesting. Thanks for the link. Out of interest do you know why that line isn't using What should happen if a user uses I wonder if we should also allow "i53" for when we know the value fits in a single JS Number? See the recent work on library_int53.js. |
|
Capstone is a library for disassembling machine code from binaries, so "address" in this context refers to address of an instruction in the parsed binary's code section. For me at least, the current state is a bit confusing. If I understand the documentation correctly, I'm not sure why we should tie
All of these flags can be relevant both to WASM and non-WASM mode. The hi/low pair is IMHO a good idea and already implemented for As for i53, not sure about this - It feels like like inviting unintended bugs, especially since there are so many instances for native APIs out there using higher bits set (ex. |
|
We are getting off topic here but wouldn't make sense to model vs For these reason we have tried to avoid widespread BitInt usage within emscripten except when actually needed. For example in many cases its convenient for us to model |
I agree in the general case it might work everything . But for emscripten we are often accepting an argument which is supposed to be a valid pointer (e.g. strcpy) or a valid size_t (e.g. size_t count in fread) then it seems reasonable to check a value is within the int53 change either return an error or accept is as a Number. See my recent change: #16877 |
|
Sorry, I forgot about this PR when I created #17341. I think that will solve this issue? |
No description provided.