From ece2b6cf58c56b5435dbfd3b3b397d6799319fb8 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 24 Oct 2024 15:18:53 -0700 Subject: [PATCH] Add missing dependency to emscripten_runtime_keepalive_clear. NFC Fixes #22783 --- src/library.js | 8 ++++---- test/test_other.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/library.js b/src/library.js index ef05b87916cea..09fe8de2b225a 100644 --- a/src/library.js +++ b/src/library.js @@ -85,7 +85,7 @@ addToLibrary({ #if PTHREADS '$exitOnMainThread', #endif -#if PTHREADS_DEBUG +#if PTHREADS_DEBUG || ASSERTIONS '$runtimeKeepaliveCounter', #endif ], @@ -2016,6 +2016,9 @@ addToLibrary({ throw 'unwind'; }, +#if !MINIMAL_RUNTIME + _emscripten_runtime_keepalive_clear__deps: ['$runtimeKeepaliveCounter'], +#endif _emscripten_runtime_keepalive_clear: () => { #if isSymbolNeeded('$noExitRuntime') noExitRuntime = false; @@ -2028,9 +2031,6 @@ addToLibrary({ emscripten_force_exit__deps: ['exit', '_emscripten_runtime_keepalive_clear', #if !EXIT_RUNTIME && ASSERTIONS '$warnOnce', -#endif -#if !MINIMAL_RUNTIME - '$runtimeKeepaliveCounter', #endif ], emscripten_force_exit__proxy: 'sync', diff --git a/test/test_other.py b/test/test_other.py index 9de3bf79e6392..588b588065d2b 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -14903,6 +14903,9 @@ def test_noExitRuntime_deps(self): def test_hello_world_argv(self): self.do_runf('hello_world_argv.c', 'hello, world! (1)') + def test_strict_closure(self): + self.emcc(test_file('hello_world.c'), ['-sSTRICT', '--closure=1']) + def test_arguments_global(self): self.emcc(test_file('hello_world_argv.c'), ['-sENVIRONMENT=web', '-sSTRICT', '--closure=1', '-O2'])