Files
Nim/compiler
metagn 52cf7dfde0 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.
2024-10-18 07:37:05 +02:00
..
2023-12-15 10:20:57 +01:00
2024-06-07 09:01:30 +02:00
2017-01-07 22:35:09 +01:00
2024-04-22 13:04:30 +02:00
2023-12-17 18:43:52 +01:00
2023-12-13 10:29:58 +01:00
2021-01-12 09:36:51 +01:00
2024-07-09 09:29:45 +02:00
2023-12-17 18:43:52 +01:00
2023-07-02 22:36:05 +02:00
2023-11-06 18:33:28 +01:00
2024-03-16 08:35:18 +08:00
2023-12-17 18:43:52 +01:00
2023-12-25 07:12:54 +01:00

Nim Compiler

  • This directory contains the Nim compiler written in Nim.
  • Note that this code has been translated from a bootstrapping version written in Pascal.
  • So the code is not a poster child of good Nim code.

See Internals of the Nim Compiler for more information.