summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-05-22 20:38:09 +0800
committerGitHub <noreply@github.com>2024-05-22 20:38:09 +0800
commit5cd141cebb3ad7504ec399a9b7140fed40049bf1 (patch)
tree321b44aa8b341869b8a47ed32f6d90cc207790fc
parent309f97af4c03c2237a890aad147c261232b73acd (diff)
downloadNim-5cd141cebb3ad7504ec399a9b7140fed40049bf1.tar.gz
fixes `reifiedOpenArray`; `nkHiddenStdConv` is PathKinds1 not PathKinds0 (#23633)
-rw-r--r--compiler/ccgcalls.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/ccgcalls.nim b/compiler/ccgcalls.nim
index 516bb6fed..8ec37bf59 100644
--- a/compiler/ccgcalls.nim
+++ b/compiler/ccgcalls.nim
@@ -150,8 +150,14 @@ proc genBoundsCheck(p: BProc; arr, a, b: TLoc)
 
 proc reifiedOpenArray(n: PNode): bool {.inline.} =
   var x = n
-  while x.kind in {nkAddr, nkHiddenAddr, nkHiddenStdConv, nkHiddenDeref}:
-    x = x[0]
+  while true:
+    case x.kind
+    of {nkAddr, nkHiddenAddr, nkHiddenDeref}:
+      x = x[0]
+    of nkHiddenStdConv:
+      x = x[1]
+    else:
+      break
   if x.kind == nkSym and x.sym.kind == skParam:
     result = false
   else: