1
0
mirror of https://github.com/golang/go synced 2024-11-19 16:44:43 -07:00
go/ssa/interp
Alan Donovan 5cbf2abd36 go.tools/ssa: ensure address-deriving operations panic on nil inputs.
&x.f, &x[0], x[i:j], &*x all must panic if x==nil.

The first three are already addressed by the semantics of
FieldAddr, IndexAddr, Slice; updated docs to reflect this.
The final case requires generation of an additional dynamic check.

See golang.org/s/go12nil for details.

Tested on $GOROOT/test/nilptr2.go (with patch from CL 13108043)

Also: remove a TODO where a no-op will do.

R=gri, crawshaw
CC=golang-dev, rsc
https://golang.org/cl/13064044
2013-08-19 17:51:33 -04:00
..
testdata go.tools/ssa: preserve type of &&/|| operands in result. 2013-08-19 12:50:40 -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: ensure address-deriving operations panic on nil inputs. 2013-08-19 17:51:33 -04:00
interp_test.go go.tools/ssa: ensure address-deriving operations panic on nil inputs. 2013-08-19 17:51:33 -04:00
interp.go go.tools/ssa: fixes, cleanups, cosmetic tweaks. 2013-08-19 15:38:30 -04:00
map.go go.tools: add go/types, ssa, and cmd/vet 2013-05-17 13:20:39 -07:00
ops.go go.tools/go/types: Fix for broken IsAssignableTo. 2013-08-05 13:54:22 -07:00
reflect.go go.tools/go/types: support for fake imports of package "C" 2013-08-07 14:09:50 -07:00
value.go go.tools/ssa: Value.Pos() method + remaining source position plumbing. 2013-05-30 09:59:17 -04:00