]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: fix function call memory
authorKeith Randall <khr@golang.org>
Wed, 12 Aug 2015 19:54:47 +0000 (12:54 -0700)
committerKeith Randall <khr@golang.org>
Wed, 12 Aug 2015 20:35:53 +0000 (20:35 +0000)
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/13586
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/ssa.go

index 75e12ee8f23e15e4af2c66b46b82359acf56d381..81f9c8f6ced592711a871b520df2ca50fa282f1e 100644 (file)
@@ -1311,6 +1311,7 @@ func (s *state) expr(n *Node) *ssa.Value {
                }
                dowidth(left.Type)
                call.AuxInt = left.Type.Argwid // call operations carry the argsize of the callee along with them
+               s.vars[&memvar] = call
                b := s.endBlock()
                b.Kind = ssa.BlockCall
                b.Control = call
@@ -1319,7 +1320,6 @@ func (s *state) expr(n *Node) *ssa.Value {
 
                // read result from stack at the start of the fallthrough block
                s.startBlock(bNext)
-               s.vars[&memvar] = call
                var titer Iter
                fp := Structfirst(&titer, Getoutarg(left.Type))
                if fp == nil {