From 91ce4515c87c084ade6b2b74ebfc2e19e25b5261 Mon Sep 17 00:00:00 2001 From: cooldome Date: Fri, 9 Oct 2020 07:52:26 +0100 Subject: [PATCH] fix gc:arc in nimscript (#15525) --- compiler/scriptconfig.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/scriptconfig.nim b/compiler/scriptconfig.nim index 13ab03426a..b359c9a482 100644 --- a/compiler/scriptconfig.nim +++ b/compiler/scriptconfig.nim @@ -228,11 +228,14 @@ proc runNimScript*(cache: IdentCache; scriptName: AbsoluteFile; # watch out, "newruntime" can be set within NimScript itself and then we need # to remember this: + if conf.selectedGC == gcUnselected: + conf.selectedGC = oldSelectedGC if optOwnedRefs in oldGlobalOptions: conf.globalOptions.incl {optTinyRtti, optOwnedRefs, optSeqDestructors} defineSymbol(conf.symbols, "nimv2") - if conf.selectedGC == gcUnselected: - conf.selectedGC = oldSelectedGC + if conf.selectedGC in {gcArc, gcOrc}: + conf.globalOptions.incl {optTinyRtti, optSeqDestructors} + defineSymbol(conf.symbols, "nimv2") # ensure we load 'system.nim' again for the real non-config stuff! resetSystemArtifacts(graph)