compiler: check for nil receiver in value method

We already dereference the pointer to copy the value, but if the
method does not use the value then the pointer dereference may be
optimized away.  Do an explicit nil check so that we get the panic
that is required.

Fixes golang/go#19806

Change-Id: Ide12b86afef732fd6cc69870d3d80b6cd90158b9
Reviewed-on: https://go-review.googlesource.com/91275
Reviewed-by: Than McIntosh <thanm@google.com>
1 file changed