From 40601ada5f001bed7d9ce5f1e61f296540ae8869 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 5 Oct 2014 03:24:39 +0200 Subject: [PATCH] fixes #1551 --- compiler/semexprs.nim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index d3650f984..34e8c6fcd 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1629,8 +1629,9 @@ proc instantiateCreateFlowVarCall(c: PContext; t: PType; result = c.semGenerateInstance(c, sym, bindings, info) # since it's an instantiation, we unmark it as a compilerproc. Otherwise # codegen would fail: - result.flags = result.flags - {sfCompilerProc, sfExportC, sfImportC} - result.loc.r = nil + if sfCompilerProc in result.flags: + result.flags = result.flags - {sfCompilerProc, sfExportC, sfImportC} + result.loc.r = nil proc setMs(n: PNode, s: PSym): PNode = result = n