]> Cypherpunks repositories - gostls13.git/commit
go/types: correctly determine if panic call refers to built-in
authorRobert Griesemer <gri@golang.org>
Thu, 21 Dec 2017 22:15:20 +0000 (14:15 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 12 Feb 2018 21:40:26 +0000 (21:40 +0000)
commit38f9d7519565d70b5921984e50036c55984b38a9
tree194151d0a22152bd0853ff1bd9ba250ef9a72b35
parentd5e47fdc92ff0be67cf004b7796ba47943a7f0c3
go/types: correctly determine if panic call refers to built-in

R=go1.11

The terminating statement check for functions that declare result
parameters was using the wrong scope to look up calls to `panic`
which in esoteric cases lead to a false positive.

Instead of looking up a panic call again at a time when correct
scope information would have to be recomputed, collect calls to
predeclared panic in a set when type-checking that call.

Fixes #23218.

Change-Id: I35eaf010e5cb8e43696efba7d77cefffb6f3deb2
Reviewed-on: https://go-review.googlesource.com/85198
Reviewed-by: Alan Donovan <adonovan@google.com>
src/go/types/builtins.go
src/go/types/check.go
src/go/types/return.go
src/go/types/testdata/stmt1.src