fixes #20 properly

This commit is contained in:
Zahary Karadjov 2012-04-15 00:38:57 +03:00
commit 567b5b07ea
4 changed files with 36 additions and 38 deletions

View file

@ -220,9 +220,8 @@ proc fitRemoveHiddenConv(c: PContext, typ: Ptype, n: PNode): PNode =
proc findShadowedVar(c: PContext, v: PSym): PSym =
for i in countdown(c.tab.tos - 2, 0):
let shadowed = StrTableGet(c.tab.stack[i], v.name)
if shadowed != nil:
if shadowed.kind in skLocalVars:
return shadowed
if shadowed != nil and shadowed.kind in skLocalVars:
return shadowed
proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym =
if isTopLevel(c):