Commit d56d2fa2 authored by Keith Randall's avatar Keith Randall

[dev.ssa] cmd/compile: fix function call memory

We need to move the memory variable update back to before endBlock
so that all successors use the right memory value.

See https://go-review.googlesource.com/13560

Change-Id: Id72e5526c56e5e070b933d3b28dc503a5a2978dc
Reviewed-on: https://go-review.googlesource.com/13586Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
parent ce977889
...@@ -1311,6 +1311,7 @@ func (s *state) expr(n *Node) *ssa.Value { ...@@ -1311,6 +1311,7 @@ func (s *state) expr(n *Node) *ssa.Value {
} }
dowidth(left.Type) dowidth(left.Type)
call.AuxInt = left.Type.Argwid // call operations carry the argsize of the callee along with them call.AuxInt = left.Type.Argwid // call operations carry the argsize of the callee along with them
s.vars[&memvar] = call
b := s.endBlock() b := s.endBlock()
b.Kind = ssa.BlockCall b.Kind = ssa.BlockCall
b.Control = call b.Control = call
...@@ -1319,7 +1320,6 @@ func (s *state) expr(n *Node) *ssa.Value { ...@@ -1319,7 +1320,6 @@ func (s *state) expr(n *Node) *ssa.Value {
// read result from stack at the start of the fallthrough block // read result from stack at the start of the fallthrough block
s.startBlock(bNext) s.startBlock(bNext)
s.vars[&memvar] = call
var titer Iter var titer Iter
fp := Structfirst(&titer, Getoutarg(left.Type)) fp := Structfirst(&titer, Getoutarg(left.Type))
if fp == nil { if fp == nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment