Files
Nim/tests/iter
metagn 75bd2d0688 shallow fold prevention for addr, nkHiddenAddr (#24322)
fixes #24305, refs #23807

Since #23014 `nkHiddenAddr` is produced to fast assign array elements in
iterators. However the array access inside this `nkHiddenAddr` can get
folded at compile time, generating invalid code. In #23807, compile time
folding of regular `addr` expressions was changed to be prevented in
`transf` but `nkHiddenAddr` was not updated alongside it.

The method for preventing folding in `addr` in #23807 was also faulty,
it should only trigger on the immediate child node of the address rather
than all nodes nested inside it. This caused a regression as outlined in
[this
comment](https://github.com/nim-lang/Nim/pull/24322#issuecomment-2419560182).

To fix both issues, `addr` and `nkHiddenAddr` now both shallowly prevent
constant folding for their immediate children.

(cherry picked from commit 52cf7dfde0)
(cherry picked from commit 7ad7ee03e5c0adb6832cbae10a62de7b68ef6fa5)
2024-10-28 09:57:30 +01:00
..
2021-01-08 14:42:38 +01:00
2021-03-24 08:49:05 +01:00
2015-01-11 13:51:30 +01:00
2019-05-03 23:43:41 +02:00
2014-01-13 02:10:03 +01:00
2019-11-05 11:05:46 +01:00
2020-03-16 13:40:40 +01:00
2019-05-30 11:18:17 +02:00
2019-11-05 16:55:08 +01:00
2019-05-13 20:50:21 +02:00
2019-05-13 20:50:21 +02:00
2019-05-13 20:50:21 +02:00
2018-12-11 21:23:21 +01:00
2014-01-13 02:10:03 +01:00
2015-07-14 01:37:07 +02:00