1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:41:21 -06:00

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

We were not recording function calls as
changing the state of memory.

As a result, the scheduler was not aware that
storing values to the stack in order to make a
function call must happen *after* retrieving
results from the stack from a just-completed
function call.

This fixes the container/ring tests.

This was my first experience debugging an issue
using the HTML output. I'm feeling quite
pleased with it.

Change-Id: I9e8276846be9fd7a60422911b11816c5175e3d0a
Reviewed-on: https://go-review.googlesource.com/13560
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2015-08-11 14:23:08 -07:00
parent 40aba8c4e7
commit 2af0648014

View File

@ -1319,6 +1319,7 @@ 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 {