emscripten-core / emscripten-core/emscripten

In MEMORY64 mode, function pointers are 64-bit, but would be better to be 32-bit

Open
#18,200 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Currently it looks like when compiling to -sMEMORY64, function pointers are 64-bit integers, and as result, e.g. {{{ makeDynCall() }}} macro does not currently work.

I cannot think of a technical reason why we would want to have 64-bit function pointers, since these will always be count-from-zero indexes to the wasm function table anyways. Would it be possible to make LLVM treat function pointers as 32-bit integers?

(soft reasons may be wanting to keep function pointers and integer pointers sizes consistent with each other, or to simplify e.g. some LLVM implementation)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.