summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-04-15 23:28:14 +0800
committerGitHub <noreply@github.com>2024-04-15 17:28:14 +0200
commit549ef24f35213302ba66e9e786c18ab9146940ee (patch)
treee188e18455068466a5ad2f39168868c5189c452d /compiler
parent7208a27c0f8396e6a6e73b36c92c870390bd0287 (diff)
downloadNim-549ef24f35213302ba66e9e786c18ab9146940ee.tar.gz
fixes #23499; don't skip `addr` when constructing `bracketExpr` (#23503)
fixes #23499

In the
https://github.com/nim-lang/Nim/commit/8990626ca9715a3687b28331aee4ccf242997aa2
the effect of `skipAddr` changed to skip `nkAddr` and `nkHiddenAddr`.
Some old code was not adapted. In the
https://github.com/nim-lang/Nim/pull/23477, the magic `addr` function
was handled in the semantic analysis phase, which causes it be skipped
incorrectly
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semmagic.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index a8b0c9f18..8db62a9c8 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -73,7 +73,7 @@ proc semArrGet(c: PContext; n: PNode; flags: TExprFlags): PNode =
 proc semArrPut(c: PContext; n: PNode; flags: TExprFlags): PNode =
   # rewrite `[]=`(a, i, x)  back to ``a[i] = x``.
   let b = newNodeI(nkBracketExpr, n.info)
-  b.add(n[1].skipAddr)
+  b.add(n[1].skipHiddenAddr)
   for i in 2..<n.len-1: b.add(n[i])
   result = newNodeI(nkAsgn, n.info, 2)
   result[0] = b