@@ -258,9 +258,7 @@ func fixedlit(ctxt initContext, kind initKind, n *ir.CompLitExpr, var_ ir.Node,
258
258
case initKindStatic :
259
259
genAsStatic (as )
260
260
case initKindDynamic , initKindLocalCode :
261
- a = orderStmtInPlace (as , map [string ][]* ir.Name {})
262
- a = walkStmt (a )
263
- init .Append (a )
261
+ appendWalkStmt (init , orderStmtInPlace (as , map [string ][]* ir.Name {}))
264
262
default :
265
263
base .Fatalf ("fixedlit: bad kind %d" , kind )
266
264
}
@@ -396,19 +394,13 @@ func slicelit(ctxt initContext, n *ir.CompLitExpr, var_ ir.Node, init *ir.Nodes)
396
394
397
395
// build list of vauto[c] = expr
398
396
ir .SetPos (value )
399
- as := typecheck .Stmt (ir .NewAssignStmt (base .Pos , a , value ))
400
- as = orderStmtInPlace (as , map [string ][]* ir.Name {})
401
- as = walkStmt (as )
402
- init .Append (as )
397
+ as := ir .NewAssignStmt (base .Pos , a , value )
398
+ appendWalkStmt (init , orderStmtInPlace (typecheck .Stmt (as ), map [string ][]* ir.Name {}))
403
399
}
404
400
405
401
// make slice out of heap (6)
406
402
a = ir .NewAssignStmt (base .Pos , var_ , ir .NewSliceExpr (base .Pos , ir .OSLICE , vauto , nil , nil , nil ))
407
-
408
- a = typecheck .Stmt (a )
409
- a = orderStmtInPlace (a , map [string ][]* ir.Name {})
410
- a = walkStmt (a )
411
- init .Append (a )
403
+ appendWalkStmt (init , orderStmtInPlace (typecheck .Stmt (a ), map [string ][]* ir.Name {}))
412
404
}
413
405
414
406
func maplit (n * ir.CompLitExpr , m ir.Node , init * ir.Nodes ) {
0 commit comments