You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a bit like a use-after-free issue where the inner procs point to memory that has become invalid and now points somewhere else (to the new value), and we are just lucky that other code doesn't end up in those variables.
Maybe compiler should check lifetime analysis and automatically inject closureScope in that case or put error / warning if user tries to use a variable in an escaping way.
Description
Nim Version
% nim -v
Nim Compiler Version 2.0.14 [MacOSX: arm64]
Compiled at 2025-01-06
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: bf4de6a
active boot switches: -d:release
Current Output
Expected Output
Known Workarounds
Use
closureScope
around thelet immutableVal = mutableVal
to ensure thatlet
contents don't change after initialization.Additional Information
Both in
--mm:refc
and--mm:orc
.The text was updated successfully, but these errors were encountered: