Skip to content

Improve longjmp stubs. NFC #18338

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

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -1241,9 +1241,7 @@ mergeInto(LibraryManager.library, {
#if SUPPORT_LONGJMP == 'emscripten'
_emscripten_throw_longjmp__sig: 'v',
_emscripten_throw_longjmp: function() { throw Infinity; },
#endif

#if !SUPPORT_LONGJMP
#elif !SUPPORT_LONGJMP
#if !INCLUDE_FULL_LIBRARY
// These are in order to print helpful error messages when either longjmp of
// setjmp is used.
Expand All @@ -1258,17 +1256,19 @@ mergeInto(LibraryManager.library, {
// built with SUPPORT_LONGJMP=1, the object file contains references of not
// longjmp but _emscripten_throw_longjmp, which is called from
// emscripten_longjmp.
_emscripten_throw_longjmp: function() { error('longjmp support was disabled (SUPPORT_LONGJMP=0), but it is required by the code (either set SUPPORT_LONGJMP=1, or remove uses of it in the project)'); },
get _emscripten_throw_longjmp__deps() {
return this.longjmp__deps;
},
#endif
_emscripten_throw_longjmp: function() {
error('longjmp support was disabled (SUPPORT_LONGJMP=0), but it is required by the code (either set SUPPORT_LONGJMP=1, or remove uses of it in the project)');
},
// will never be emitted, as the dep errors at compile time
longjmp: function(env, value) {
abort('longjmp not supported');
abort('longjmp not supported (build with -s SUPPORT_LONGJMP)');
},
setjmp: function(env, value) {
abort('setjmp not supported');
setjmp: function(env) {
abort('setjmp not supported (build with -s SUPPORT_LONGJMP)');
},
#endif

Expand Down