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

Fix MAIN_THREAD_EM_ASM + CAN_ADDRESS_2GB #21292

Merged
merged 1 commit into from
Feb 8, 2024

Commits on Feb 8, 2024

  1. Fix MAIN_THREAD_EM_ASM_INT + CAN_ADDRESS_2GB

    We were using the sign bit of an integer to distinguish between data
    pointers and fixed JS function indexes, but that doesn't work once
    that data address can be larger than 2^31.
    
    Technically this is very unlikely in practice since in order to get
    an EM_ASM address over 2^31 you would either need 2Gb of static data
    to be using `-sGLOBAL_BASE=2gb` like we do in the tests.
    
    An alternative approach here would be assume we have fewer than
    `GLOBAL_BASE` (1024 is most cases) proxied JS library functions and then
    we could assume that small integers we JS library functions and larger
    ones were data pointers (EM_ASM functions).  However that seems fragile
    too.  Passing an extra argument around seems like a small cost here.
    sbc100 committed Feb 8, 2024
    Configuration menu
    Copy the full SHA
    792db7d View commit details
    Browse the repository at this point in the history