- 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
Running the interpreter on (most of) the tests package in
"encoding" unearthed a couple of ssa.builder bugs, already
fixed. This CL contains the interpreter fixes that were
required. (The "encoding" tests aren't added to the suite
since they're slow.)
Added intrinsics for:
math.Exp
math.Min
hash/crc32.haveSSE42
(reflect.Type).Field
(reflect.Type).NumField
(reflect.Type).NumMethod
reflect.New
(reflect.Value).NumMethod
syscall.RawSyscall (returns ENOSYS)
reflect.Set (a no-op)
Treat unsafe.Pointer -> *T conversions by returning new(T).
This is incorrect but at least preserves type-safety,
which is sufficient for these tests.
hashmap: treat nil *hashmap as an empty map.
R=gri
CC=golang-dev
https://golang.org/cl/12901046
They will be deleted from their current homes once this has landed.
Changes made to import paths to make the code compile, and to find
errchk in the right place in cmd/vet's Makefile.
TODO in a later CL: tidy up vet.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/9495043