mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
Prevent early destruction of gFuns, fixes AddressSanitizer: heap-use-after-free (#22386)
Prevent destruction of gFuns before callClosures
(cherry picked from commit e0396900ed)
This commit is contained in:
committed by
narimiran
parent
fb2cc06557
commit
36b339bbcf
@@ -22,7 +22,7 @@ type
|
||||
|
||||
var
|
||||
gFunsLock: Lock
|
||||
gFuns: seq[Fun]
|
||||
gFuns {.cursor.}: seq[Fun] #Intentionally use the cursor to break up the lifetime trace and make it compatible with JS.
|
||||
|
||||
initLock(gFunsLock)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user