-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gopls/internal/analysis/stubmethods: fix OOB panic in fromValueSpec
The loop over ValueSpec.Rhs assumed it was nonempty, but it's possible to spuriously trigger a "cannot convert" error when the problem is on the LHS. (I don't know if the attached test case is what caused the panic in the field, but it seems plausible.) Added a test, similar to the one to fix golang/go#64087. Also, audit for similar mistakes, and tidy the code up, to use conventional variable names and simpler logic. Fixes golang/go#64545 Change-Id: I49851435e7a363641a2844620633099b11f1e414 Reviewed-on: https://go-review.googlesource.com/c/tools/+/548737 Auto-Submit: Alan Donovan <[email protected]> Reviewed-by: Robert Findley <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
- Loading branch information
Showing
2 changed files
with
138 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters