1
0
mirror of https://github.com/golang/go synced 2024-10-01 08:18:32 -06:00
go/ssa/interp
Alan Donovan 5db6491e90 go.tools/ssa/interp: fixes to equivalence relations.
- This change implements the correct type-based equivalence
  relation for aggregate types. e.g. comparison of struct
  types no longer compares the anonymous fields.  We do
  analogous things for hash().

- equals() and eqnil() have been separated: the former panics
  for uncomparable types, the latter permits comparisons of
  slice/map/func types against a literal nil and is intended
  for use only by "static" ssa.BinOp(EQL), not "dynamic" slice
  comparisons encountered during (e.g.) interface comparisons,
  which should panic regardless of operand nilness.

- we use a (global) typemap.Hasher to compute type hashes;
  hashing the Type.String() value was not sound.

+ tests.

NB, this change unearthed a bug in defer/recover within
init(); it will be fixed in a followup change.

R=gri, crawshaw
CC=golang-dev
https://golang.org/cl/13719043
2013-09-16 15:22:19 -04:00
..
testdata go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
external_plan9.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
external_unix.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
external_windows.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
external.go go.tools/ssa/interp: fixes to enable running tests of package "encoding". 2013-09-12 11:00:31 -04:00
interp_test.go go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
interp.go go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
map.go go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
ops.go go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00
reflect.go go.tools/go/types: separate package descriptor from package object 2013-09-13 09:52:57 -07:00
value.go go.tools/ssa/interp: fixes to equivalence relations. 2013-09-16 15:22:19 -04:00