]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: fix function call memory accounting
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 11 Aug 2015 21:23:08 +0000 (14:23 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 11 Aug 2015 21:51:16 +0000 (21:51 +0000)
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>
src/cmd/compile/internal/gc/ssa.go

index 13a6d6c0095d496a238e88d65f6ef665062b757a..dcc7de8d04c5a2ac19dcfab65bb5590057812bcd 100644 (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 {