From e885d89f6370edb288ac94876152bff7211ebf23 Mon Sep 17 00:00:00 2001 From: xflywind <43030857+xflywind@users.noreply.github.com> Date: Wed, 29 Jun 2022 10:48:00 +0800 Subject: [PATCH] FIX AGAIN --- compiler/cgen.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/cgen.nim b/compiler/cgen.nim index 29527075f8..4878c3f322 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -474,7 +474,7 @@ proc constructLoc(p: BProc, loc: var TLoc, isTemp = false) = genObjectInit(p, cpsStmts, loc.t, loc, constructObj) proc initLocalVar(p: BProc, v: PSym, immediateAsgn: bool) = - if sfNoInit notin v.flags or p.config.selectedGC in {gcArc, gcOrc}: + if sfNoInit notin v.flags: # we know it is a local variable and thus on the stack! # If ``not immediateAsgn`` it is not initialized in a binding like # ``var v = X`` and thus we need to init it. @@ -1064,7 +1064,7 @@ proc genProcAux(m: BModule, prc: PSym) = # the 'unsureAsgn' is a nop. If it points to a global variable the # global is either 'nil' or points to valid memory and so the RC operation # succeeds without touching not-initialized memory. - if sfNoInit in prc.flags: discard + if sfNoInit in prc.flags and p.config.selectedGC notin {gcArc, gcOrc}: discard elif allPathsAsgnResult(procBody) == InitSkippable: discard else: resetLoc(p, res.loc)