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
commit c661f8e1be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 =