]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/gc: make indirect calls properly escape-y
authorDavid Chase <drchase@google.com>
Thu, 21 May 2015 16:40:25 +0000 (12:40 -0400)
committerDavid Chase <drchase@google.com>
Fri, 22 May 2015 01:36:11 +0000 (01:36 +0000)
commitb19ec6842d3d3bdc6d7b67fa065121a9d317cff7
treeae44b31583bcad3cf1b64aff283987a8a11eb4b2
parentc344f751fced679add6eec87c4dc92020484e476
cmd/internal/gc: make indirect calls properly escape-y

Indirect function and method calls should leak everything,
but they didn't.

This fix had no particular effect on the cost of running the
compiler on html/template/*.go and added a single new "escape"
to the standard library:

    syscall/syscall_unix.go:85: &b[0] escapes to heap
in
if errno := m.munmap(uintptr(unsafe.Pointer(&b[0])),
                     uintptr(len(b))); errno != nil {

Added specific escape testing to escape_calls.go
(and verified that it fails without this patch)

I also did a little code cleanup around the changes in esc.c.

Fixes #10925

Change-Id: I9984b701621ad4c49caed35b01e359295c210033
Reviewed-on: https://go-review.googlesource.com/10295
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/esc.go
test/escape_calls.go
test/fixedbugs/issue10925.go [new file with mode: 0644]