File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -4939,6 +4939,10 @@ func CheckTypeAssertionShadowingElse(pass *analysis.Pass) (interface{}, error) {
49394939 return
49404940 }
49414941 irfn := ir .EnclosingFunction (irpkg , path )
4942+ if irfn == nil {
4943+ // For example for functions named "_", because we don't generate IR for them.
4944+ return
4945+ }
49424946
49434947 shadoweeIR , isAddr := irfn .ValueForExpr (m .State ["obj" ].(* ast.Ident ))
49444948 if shadoweeIR == nil || isAddr {
@@ -5088,6 +5092,10 @@ func CheckAllocationNilCheck(pass *analysis.Pass) (interface{}, error) {
50885092 path = append (path , stack [i ])
50895093 }
50905094 irfn := ir .EnclosingFunction (irpkg , path )
5095+ if irfn == nil {
5096+ // For example for functions named "_", because we don't generate IR for them.
5097+ return
5098+ }
50915099 v , isAddr := irfn .ValueForExpr (lhs )
50925100 if isAddr {
50935101 return
You can’t perform that action at this time.
0 commit comments