summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2024-06-07 09:01:30 +0200
committerGitHub <noreply@github.com>2024-06-07 09:01:30 +0200
commit7039b8b5bc5c62cdd608a769e0ea556e23973cc5 (patch)
treefa4e644892846e1d333f9b9311efe1bb1efd2a12 /compiler
parent8f5ae28fab113c425d22e5abc230f456fa627744 (diff)
downloadNim-7039b8b5bc5c62cdd608a769e0ea556e23973cc5.tar.gz
fixes #23354; [backport] (#23685)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgutils.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim
index 6b106984c..c0e574186 100644
--- a/compiler/ccgutils.nim
+++ b/compiler/ccgutils.nim
@@ -90,6 +90,9 @@ proc ccgIntroducedPtr*(conf: ConfigRef; s: PSym, retType: PType): bool =
     if s.typ.sym != nil and sfForward in s.typ.sym.flags:
       # forwarded objects are *always* passed by pointers for consistency!
       result = true
+    elif s.typ.kind == tySink and conf.selectedGC notin {gcArc, gcAtomicArc, gcOrc, gcHooks}:
+      # bug #23354:
+      result = false
     elif (optByRef in s.options) or (getSize(conf, pt) > conf.target.floatSize * 3):
       result = true           # requested anyway
     elif (tfFinal in pt.flags) and (pt[0] == nil):