Repository navigation
JIT: a throw under rc, none and own links without TypeScriptRuntime.dll - #418
Merged
Merged
Conversation
…plement type_info vtable handling
ASDAlexander77
added a commit
that referenced
this pull request
Sep 30, 2026
#419's split of the async runtime applies to the static library on Linux as well, and before it the failure was the same there: checked in WSL at #418, the scheduler's object (AsyncRuntime.cpp.o) referenced GC_allow_register_threads, GC_register_my_thread, GC_unregister_my_thread and GC_get_stack_base, and 00async_await.ts built with `tslang --emit=exe` under rc, none and own failed to link ("undefined reference to `GC_register_my_thread'"). At main only AsyncGCThreads.cpp.o references them, and all four models link and run at -O0 and -O3. The test was registered for Windows only; async-without-collector.cmake passes as is on Linux, so the guard goes. Its comments name both platforms' messages and linkers. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Under the JIT, any program with a
throwfailed to run under-mm=rc,noneandownunless--shared-libs=TypeScriptRuntime.dllwas passed:This is the rc JIT
type_infogap noted in #417. It isn't specific toanycomparisons: everythrowhits it.Cause
type_info's vtable,??_7type_info@@6B@.TypeScriptRuntime.dllre-exports its own copy (mlir_init.cpp). A JIT run loads that DLL by itself only undergc.Fix
jit.cppbinds??_7type_info@@6B@itself, next to__CxxFrameHandler3and_CxxThrowException. It uses tslang.exe's own vtable, read fromtypeid(int), which is the same static CRT as the exception personality. Undergcthis definition now shadows the DLL's copy.Tests
test-runneralways passes--shared-libs=TypeScriptRuntime.dll, which is why the suite never saw this.The new
test-jit-throw-without-runtime(jit-throw-without-runtime.cmake, Windows only) runs00jit_throw_without_runtime.tsunder the JIT with no--shared-libs, under rc, none and own. The program throws and catches a number, a string and a class instance. Before the change it fails in all three models.Results
00any_equality_undefined.ts(#417), JIT with the default lib and no--shared-libs, gc and rc🤖 Generated with Claude Code