Merge pull request #8983 from cooldome/codegen_crash

Fixes 8979
This commit is contained in:
Andreas Rumpf
2018-09-18 09:36:16 +02:00
committed by GitHub
2 changed files with 35 additions and 2 deletions

View File

@@ -707,7 +707,7 @@ proc containsResult(n: PNode): bool =
for i in 0..<n.safeLen:
if containsResult(n[i]): return true
const harmless = {nkConstSection, nkTypeSection, nkEmpty, nkCommentStmt} +
const harmless = {nkConstSection, nkTypeSection, nkEmpty, nkCommentStmt, nkTemplateDef, nkMacroDef} +
declarativeDefs
proc easyResultAsgn(n: PNode): PNode =