Fix nogo analysis.

Ignore calls to atomic functions in case there is no analysis information.
It is unclear why this has broken in some cases, perhaps these functions
have been replaced by intrinsics as an optimization?

PiperOrigin-RevId: 374682441
This commit is contained in:
Adin Scannell
2021-05-19 10:56:45 -07:00
committed by gVisor bot
parent 52394c34af
commit 2f3eda37a4
+7 -2
View File
@@ -709,8 +709,13 @@ func run(pass *analysis.Pass, localEscapes bool) (interface{}, error) {
return
}
// Recursively collect information from
// the other analyzers.
// If this package is the atomic package, the implementation
// may be replaced by instrinsics that don't have analysis.
if x.Pkg.Pkg.Path() == "sync/atomic" {
return
}
// Recursively collect information.
var imp packageEscapeFacts
if !pass.ImportPackageFact(x.Pkg.Pkg, &imp) {
// Unable to import the dependency; we must