Commit 2af06480 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

[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/13560Reviewed-by: default avatarKeith Randall <khr@golang.org>
parent 40aba8c4
......@@ -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 {
......
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