summary refs log tree commit diff stats
path: root/lib/pure/algorithm.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-09-05 16:31:28 +0800
committerGitHub <noreply@github.com>2023-09-05 10:31:28 +0200
commiteb91cf991aa9840639cc358c21d503e4cf27e268 (patch)
treee1137ee11b01c92e8a5bce137969abb14d8cf126 /lib/pure/algorithm.nim
parent6000cc8c0f5c71fd0495172b5680ab6b1945428c (diff)
downloadNim-eb91cf991aa9840639cc358c21d503e4cf27e268.tar.gz
fixes #22619; don't lift cursor fields in the hook calls (#22638)
fixes https://github.com/nim-lang/Nim/issues/22619

It causes double free for closure iterators because cursor fields are
destroyed in the lifted destructors of `Env`.

Besides, according to the Nim manual

> In fact, cursor more generally prevents object
construction/destruction pairs and so can also be useful in other
contexts.

At least, destruction of cursor fields might cause troubles.


todo
- [x] tests
- [x] revert a certain old PR

---------

Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
Diffstat (limited to 'lib/pure/algorithm.nim')
0 files changed, 0 insertions, 0 deletions