Commit ef3d603
committed
gopls/internal/golang/completion: fix crash with extra results
Fix an incorrect condition when extracting expected result types: we
must check the length of signature, not number of returns, before
accessing the expected result type.
Fixes golang/go#70636
Change-Id: I59d84283073c99117c40de584db6f576f2484206
Reviewed-on: https://go-review.googlesource.com/c/tools/+/632936
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>1 parent 8ffeaba commit ef3d603
File tree
2 files changed
+24
-1
lines changed- gopls/internal
- golang/completion
- test/marker/testdata/completion
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2624 | 2624 | | |
2625 | 2625 | | |
2626 | 2626 | | |
2627 | | - | |
| 2627 | + | |
2628 | 2628 | | |
2629 | 2629 | | |
2630 | 2630 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments