Skip to content

__stack_pointer, __memory_base, __table_base missing 4GB handling? #25763

@juj

Description

@juj

emscripten/src/lib/libcore.js

Lines 2187 to 2193 in 7dd9069

// Globals that are normally exported from the wasm module but in relocatable
// mode are created here and imported by the module.
__stack_pointer: "new WebAssembly.Global({'value': '{{{ POINTER_WASM_TYPE }}}', 'mutable': true}, {{{ to64(STACK_HIGH) }}})",
// tell the memory segments where to place themselves
__memory_base: "new WebAssembly.Global({'value': '{{{ POINTER_WASM_TYPE }}}', 'mutable': false}, {{{ to64(GLOBAL_BASE) }}})",
// the wasm backend reserves slot 0 for the NULL function pointer
__table_base: "new WebAssembly.Global({'value': '{{{ POINTER_WASM_TYPE }}}', 'mutable': false}, {{{ to64(TABLE_BASE) }}})",

These utilize {{{ to64('foo') }}} to handle Wasm64 case. And 2GB memory case is handled by default.

Though shouldn't there be a >>> 0 for 4GB memory mode? Iirc these values come out as int32 also?

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