commit | 71758f9ca1804743afe178f0e2fca489e0217474 | [log] [tgz] |
---|---|---|
author | Ian Lance Taylor <iant@golang.org> | Wed Jan 31 16:28:49 2018 -0800 |
committer | Ian Lance Taylor <iant@golang.org> | Thu Feb 01 01:36:34 2018 +0000 |
tree | 64101f15c6ed1e7bdc3da4331ab8f47e9c362491 | |
parent | 65eaa9003db4effc9c5ffe9c955e9534ba5d7d15 [diff] |
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>