-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ssa instantiate generics. Fixes golang/go#57174 Change-Id: I2d2e28a48e3a64df3d4d415b4629fe3e0a1ba28d Reviewed-on: https://go-review.googlesource.com/c/vuln/+/456436 Reviewed-by: Fnu Harshavardhana <[email protected]> Run-TryBot: Zvonimir Pavlinovic <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Jonathan Amsterdam <[email protected]>
- Loading branch information
1 parent
8229fe2
commit dc6157d
Showing
2 changed files
with
54 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -848,3 +848,55 @@ func TestRecursion(t *testing.T) { | |
t.Errorf("want 3 functions (X, y, Vuln) in vulnerability graph; got %v", l) | ||
} | ||
} | ||
|
||
func TestIssue57174(t *testing.T) { | ||
e := packagestest.Export(t, packagestest.Modules, []packagestest.Module{ | ||
{ | ||
Name: "golang.org/entry", | ||
Files: map[string]interface{}{ | ||
"x/x.go": ` | ||
package x | ||
import "golang.org/bmod/bvuln" | ||
func P(d [][3]int) { | ||
p(d) | ||
} | ||
func p[E interface{ [3]int | [4]int }](d []E) { | ||
c := d[0] | ||
if c[0] > 0 { | ||
bvuln.Vuln() | ||
} | ||
} | ||
`, | ||
}, | ||
}, | ||
{ | ||
Name: "golang.org/[email protected]", | ||
Files: map[string]interface{}{"bvuln/bvuln.go": ` | ||
package bvuln | ||
func Vuln() {} | ||
`}, | ||
}, | ||
}) | ||
defer e.Cleanup() | ||
|
||
// Load x as entry package. | ||
pkgs, err := test.LoadPackages(e, path.Join(e.Temp(), "entry/x")) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if len(pkgs) != 1 { | ||
t.Fatal("failed to load x test package") | ||
} | ||
|
||
cfg := &Config{ | ||
Client: testClient, | ||
} | ||
_, err = Source(context.Background(), Convert(pkgs), cfg) | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
} |
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