diff options
| author | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:07:05 +0000 |
|---|---|---|
| committer | TreXito <81475944+TreXito@users.noreply.github.com> | 2026-11-23 21:07:05 +0000 |
| commit | 254cabbd29302dd5f2edc20d8555c0558af8f43c (patch) | |
| tree | d3da43e304c3e0c1b9bd64f6b4083663dc600b0d /runtime/src/pe_loader.cpp | |
| parent | b3baf25c385046f4998b642951a32b9b6ee1a9b4 (diff) | |
| parent | a9085b661c3637ce4d154dab3c0d5b4a436d90ec (diff) | |
Merge #4313 (latest head) into own/main
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index fd9299517..396d362f8 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -761,8 +761,9 @@ void run_callbacks(Module& m, uint32_t reason, bool trace = false) { | |||
| 761 | // of this process. | 761 | // of this process. |
| 762 | // | 762 | // |
| 763 | // What makes that safe: | 763 | // What makes that safe: |
| 764 | // - The slot is the helper's, and nothing reads the helper's variable, so swapping the pointer under a running | 764 | // - The slot is the helper's, and nothing reads the helper's variable; slot 0 (kMainImageSlot) holds gta6rt.exe's |
| 765 | // thread disturbs nothing; the thread cannot be in mapped code of a module whose load() has not returned. | 765 | // original block, which nothing reads after reserve_tls_index0 moved gta6rt's TLS. So swapping the pointer under a |
| 766 | // running thread disturbs nothing; the thread cannot be in mapped code of a module whose load() has not returned. | ||
| 766 | // - The swap is made with g_tls_lock held exclusively, so no thread is inside its attach or detach event meanwhile. | 767 | // - The swap is made with g_tls_lock held exclusively, so no thread is inside its attach or detach event meanwhile. |
| 767 | // - A thread whose detach event has run is skipped (`ended`), and so is one with no TLS array or no helper block: | 768 | // - A thread whose detach event has run is skipped (`ended`), and so is one with no TLS array or no helper block: |
| 768 | // Windows is about to free, or never built, what the block would go into. | 769 | // Windows is about to free, or never built, what the block would go into. |