Skip to content

wasm64: emscripten library functions which take pointers throw TypeError: Cannot convert number to BigInt #20274

@jspanchu

Description

@jspanchu

Methods like emscripten_set_main_loop_arg and html5 callback functions which take a void* userData as their second parameter throw TypeError: Cannot convert number to BigInt.

This can easily be reproduced by compiling test/emscripten_api_browser.c with memory64 flag.

emcc test/emscripten_api_browser.c -o index.html -sMEMORY64=1

Output:
image

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.46-git (7c7321c265c47d54dacdd25d00c2c3c9ec2a8425)
Copyright (C) 2014 the Emscripten authors (see AUTHORS.txt)
This is free and open source software under the MIT license.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Version of browser:
Chromium Version 119.0.6011.0 (Developer Build) custom (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions