Skip to content

Don't define JS versions of abort or __assert_fail in standalone mode #21317

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
Feb 12, 2024
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
4 changes: 4 additions & 0 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ addToLibrary({
// stdlib.h
// ==========================================================================

#if !STANDALONE_WASM
// TODO: There are currently two abort() functions that get imported to asm
// module scope: the built-in runtime function abort(), and this library
// function _abort(). Remove one of these, importing two functions for the
Expand All @@ -385,6 +386,7 @@ addToLibrary({
abort('');
#endif
},
#endif

// This object can be modified by the user during startup, which affects
// the initial values of the environment accessible by getenv.
Expand Down Expand Up @@ -426,9 +428,11 @@ addToLibrary({
// assert.h
// ==========================================================================

#if !STANDALONE_WASM
__assert_fail: (condition, filename, line, func) => {
abort(`Assertion failed: ${UTF8ToString(condition)}, at: ` + [filename ? UTF8ToString(filename) : 'unknown filename', line, func ? UTF8ToString(func) : 'unknown function']);
},
#endif

// ==========================================================================
// time.h
Expand Down