Opened 3 years ago
Closed 3 years ago
#5216 closed change (fixed)
[emscripten] Use a more reliable way of retrieving mangled function name
Reported by: | trev | Assignee: | trev |
---|---|---|---|
Priority: | P2 | Milestone: | |
Module: | Core | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | #4122, #5137 | Platform: | Unknown / Cross platform |
Ready: | yes | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
For bindings generation, we are currently using a huge hack in order to turn a function pointer into a function name. We call the function in such a way that it will crash, then extract the name from the exception stack trace. This doesn't work with a function I want to expose in #5137 because it doesn't take any parameters and doesn't use stack.
What to change
Emscripten allows using libraries implemented in JavaScript, and the code of these libraries can run within the asm.js module. This means that it can access the function tables directly, without any hacks. While this approach still relies on some implementation details, it should be way more reliable.
Change History (3)
comment:1 Changed 3 years ago by trev
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:2 Changed 3 years ago by abpbot
comment:3 Changed 3 years ago by trev
- Resolution set to fixed
- Status changed from reviewing to closed
A commit referencing this issue has landed:
Issue 5216 - [emscripten Use a more reliable way of retrieving mangled function name]