]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: temporarily pin the Checker to Interface during checking
authorRobert Findley <rfindley@google.com>
Wed, 8 Sep 2021 13:58:44 +0000 (09:58 -0400)
committerRobert Findley <rfindley@google.com>
Wed, 8 Sep 2021 17:35:45 +0000 (17:35 +0000)
commitc8d4fe2adc556317f75c2ebad195568ad5ff9644
treed19e79f1c21c88abc757d951a640b259df89b59c
parentd419f9c6124557e0bf08e00d7848e3e518ac4cbd
go/types: temporarily pin the Checker to Interface during checking

While type checking expressions involving interface types, it is
possible that their type set is used before delayed actions are
processed. As a result, computeInterfaceTypeSet is called with a nil
checker, and errors in the interface type definition result in panics
(see #48234).

To avoid the panics, store a *Checker on Interface for use in between
checking of the interface type expression and processing of delayed
actions.

Fixes #48234

Change-Id: I5509bc1c01b55edac52446b9e075fbe8fcc01874
Reviewed-on: https://go-review.googlesource.com/c/go/+/348371
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/interface.go
src/go/types/sizeof_test.go
src/go/types/testdata/fixedbugs/issue48234.go2 [new file with mode: 0644]
src/go/types/universe.go