Apply suggestions from code review

This commit is contained in:
ringabout
2025-01-24 17:34:58 +08:00
committed by GitHub
parent 1b004f1632
commit b66ff0b6ac

View File

@@ -2450,7 +2450,7 @@ proc semQuoteAst(c: PContext, n: PNode): PNode =
# don't allow templates to capture syms without backticks
let oldScope = c.currentScope
# c.currentScope = PScope(parent: nil, symbols: initStrTable(), depthLevel: 0)
if c.p.owner.kind in routineKinds:
if c.p.owner != nil and c.p.owner.kind in routineKinds:
# skips the current routine scopes
block exitLabel:
while c.currentScope != nil: