Have cgen zero-initialize all local variables

This commit is contained in:
Nigel Tao committed 2018-12-27 11:54:33 +11:00
1 parent 6dc68950c0
commit 983cebd893
5 files changed
+183 -335

No files matched your search

+1 -2
View File
@@ -84,8 +84,7 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
case a.KRet:
return g.writeStatementRet(b, n.AsRet(), depth)
case a.KVar:
n := n.AsVar()
return g.writeStatementAssign(b, n.Name(), nil, n.XType(), t.IDEq, nil, depth)
return nil
case a.KWhile:
return g.writeStatementWhile(b, n.AsWhile(), depth)
}