-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Open
Description
The place we increase refcount is different in Emscripten EH and Wasm EH, which is explained in detail here:
Lines 1689 to 1697 in 2a3bb65
| #ifdef __USING_EMSCRIPTEN_EXCEPTION__ | |
| // FIXME Currently Wasm EH and Emscripten EH increases | |
| // refcounts in different places. Wasm EH sets the refcount to | |
| // 1 when throwing, and decrease it in __cxa_end_catch. | |
| // Emscripten EH sets the refcount to 0 when throwing, and | |
| // increase it in __cxa_begin_catch, and decrease it in | |
| // __cxa_end_catch. Fix this inconsistency later. | |
| incrementExceptionRefcount(p); | |
| #endif |
So if you want to make the code work for both of them, you should put something like #ifdef in the code to prevent memory from leaking. It'd be good to fix this inconsistency.
stevenwdv
Metadata
Metadata
Assignees
Labels
No labels