parent
c0824b9b80
commit
81087c949f
25 changed files with 116 additions and 70 deletions
|
|
@ -926,7 +926,7 @@ proc easyResultAsgn(n: PNode): PNode =
|
|||
var i = 0
|
||||
while i < n.len and n[i].kind in harmless: inc i
|
||||
if i < n.len: result = easyResultAsgn(n[i])
|
||||
of nkAsgn, nkFastAsgn:
|
||||
of nkAsgn, nkFastAsgn, nkSinkAsgn:
|
||||
if n[0].kind == nkSym and n[0].sym.kind == skResult and not containsResult(n[1]):
|
||||
incl n.flags, nfPreventCg
|
||||
return n[1]
|
||||
|
|
@ -968,7 +968,7 @@ proc allPathsAsgnResult(n: PNode): InitResultEnum =
|
|||
for it in n:
|
||||
result = allPathsAsgnResult(it)
|
||||
if result != Unknown: return result
|
||||
of nkAsgn, nkFastAsgn:
|
||||
of nkAsgn, nkFastAsgn, nkSinkAsgn:
|
||||
if n[0].kind == nkSym and n[0].sym.kind == skResult:
|
||||
if not containsResult(n[1]): result = InitSkippable
|
||||
else: result = InitRequired
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue