DFA: fixes wrong 'def' instruction emission

This commit is contained in:
Andreas Rumpf 2019-03-05 05:54:08 +01:00
commit 9c6b628df6

View file

@ -594,11 +594,12 @@ proc genCall(c: var Con; n: PNode) =
inc c.inCall inc c.inCall
for i in 1..<n.len: for i in 1..<n.len:
gen(c, n[i]) gen(c, n[i])
if t != nil and i < t.len and t.sons[i].kind == tyVar: when false:
# XXX This is wrong! Pass by var is a 'might def', not a 'must def' if t != nil and i < t.len and t.sons[i].kind == tyVar:
# like the other defs we emit. This is not good enough for a move # XXX This is wrong! Pass by var is a 'might def', not a 'must def'
# optimizer. # like the other defs we emit. This is not good enough for a move
genDef(c, n[i]) # optimizer.
genDef(c, n[i])
# every call can potentially raise: # every call can potentially raise:
if c.inTryStmt > 0 and canRaise(n[0]): if c.inTryStmt > 0 and canRaise(n[0]):
# we generate the instruction sequence: # we generate the instruction sequence: