summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2024-09-19 21:17:25 +0800
committerGitHub <noreply@github.com>2024-09-19 15:17:25 +0200
commit755307be61e4ee7b32c8354b2c303d04bdfc3a3e (patch)
treec7f05dc59ec5e9f8e546b90207dc2e337282b7fc /compiler
parent05a7a48a2bcc21c772bd35703fa52e374d25febe (diff)
downloadNim-755307be61e4ee7b32c8354b2c303d04bdfc3a3e.tar.gz
fixes #24141; Calling algorithm reverse causes a SIGSEGV on ORC (#24142)
fixes #24141
Diffstat (limited to 'compiler')
-rw-r--r--compiler/transf.nim7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim
index 0a4579171..8dd24e090 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -511,7 +511,12 @@ proc transformAddrDeref(c: PTransf, n: PNode, kinds: TNodeKinds): PNode =
     if n[0].kind in kinds and
         not (n[0][0].kind == nkSym and n[0][0].sym.kind == skForVar and
           n[0][0].typ.skipTypes(abstractVar).kind == tyTuple
-        ): # elimination is harmful to `for tuple unpack` because of newTupleAccess
+        ) and not (n[0][0].kind == nkSym and n[0][0].sym.kind == skParam and
+          n.typ.kind == tyVar and
+          n.typ.skipTypes(abstractVar).kind == tyOpenArray and
+          n[0][0].typ.skipTypes(abstractVar).kind == tyString)
+        : # elimination is harmful to `for tuple unpack` because of newTupleAccess
+          # it is also harmful to openArrayLoc (var openArray) for strings
       # addr ( deref ( x )) --> x
       result = n[0][0]
       if n.typ.skipTypes(abstractVar).kind != tyOpenArray: