tools/go/ssa/interp
Alan Donovan 868c429971 go/ssa/interp: fix bug causing subelements of aggregates to change address.
Since all SSA values are immutable, no value copying is required for
any operations except those that load from or store to a variable;
those operations must do an aggregate copy, i.e., descend into struct
and array elements.  All other calls to copyVal have been removed;
they were pieces of duct tape, as I had long suspected.

The descent must be based on the static type information, not the
"shape" of the dynamic value, since two reflect.Value structs may have
different internal shapes.  We clobber the true definition of
reflect.Value's underlying type, replacing it with struct{interface{},
interface{}}, which is close enough to make the load/store functions
work.

+ Test

Change-Id: I5e239d91ed0cb2a669a9f75766024fe1f9a5c347
Reviewed-on: https://go-review.googlesource.com/7532
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-13 18:22:38 +00:00
..
testdata go/ssa/interp: fix bug causing subelements of aggregates to change address. 2015-03-13 18:22:38 +00:00
external.go go/ssa/interp: delete SSA bodies from standalone functions in "reflect" 2014-12-29 17:35:17 +00:00
external_darwin.go go/ssa/interp: add syscall.Sysctl to Darwin. 2014-03-04 13:34:45 -05:00
external_freebsd.go go.tools/go/ssa/interp: add wrappers for Sysctl{,Uint32} intrinsics on FreeBSD 2014-04-18 15:58:12 -04:00
external_plan9.go go.tools/ssa/interp: add intrinsics for (*sync.Pool).{Get,Put}. 2014-01-27 13:11:16 -05:00
external_unix.go go.tools/ssa/interp: add intrinsics for (*sync.Pool).{Get,Put}. 2014-01-27 13:11:16 -05:00
external_windows.go go.tools/ssa/interp: add intrinsics for (*sync.Pool).{Get,Put}. 2014-01-27 13:11:16 -05:00
interp.go go/ssa/interp: fix bug causing subelements of aggregates to change address. 2015-03-13 18:22:38 +00:00
interp_test.go go/loader: rename SourceImports flag to ImportFromBinary and invert sense 2015-02-23 23:01:10 +00:00
map.go go.tools: use golang.org/x/... import paths 2014-11-10 08:50:40 +11:00
ops.go go/ssa/interp: fix bug causing subelements of aggregates to change address. 2015-03-13 18:22:38 +00:00
reflect.go go/ssa/interp: fix bug causing subelements of aggregates to change address. 2015-03-13 18:22:38 +00:00
value.go go/ssa/interp: fix bug causing subelements of aggregates to change address. 2015-03-13 18:22:38 +00:00