This commit is contained in:
Araq 2015-03-16 23:16:56 +01:00
commit cc26308044
3 changed files with 8 additions and 2 deletions

View file

@ -460,7 +460,7 @@ proc notNilCheck(tracked: PEffects, n: PNode, paramType: PType) =
if n.kind == nkAddr:
# addr(x[]) can't be proven, but addr(x) can:
if not containsNode(n, {nkDerefExpr, nkHiddenDeref}): return
elif n.kind == nkSym and n.sym.kind in routineKinds:
elif (n.kind == nkSym and n.sym.kind in routineKinds) or n.kind in procDefs:
# 'p' is not nil obviously:
return
case impliesNotNil(tracked.guards, n)