Keith Randall would like Junyang Shao to review this change.
cmd/compile: fix bloop test
Not 100% sure this is right, but it seems to fix the issue.
Fixes #77832
diff --git a/src/cmd/compile/internal/bloop/bloop.go b/src/cmd/compile/internal/bloop/bloop.go
index 4a7a57e..8af29b7 100644
--- a/src/cmd/compile/internal/bloop/bloop.go
+++ b/src/cmd/compile/internal/bloop/bloop.go
@@ -86,7 +86,7 @@
if name != nil {
debugName(name, pos)
return ir.Nodes{name}
- } else if deref := n.(*ir.StarExpr); deref != nil {
+ } else if deref, ok := n.(*ir.StarExpr); ok && deref != nil {
if base.Flag.LowerM > 1 {
base.WarnfAt(pos, "dereference will be kept alive")
}
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
cmd/compile: fix bloop test
Not 100% sure this is right, but it seems to fix the issue.
Fixes #77832
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Keith Randall would like Junyang Shao to review this change.
[release-branch.go1.26] cmd/compile: fix bloop test
Backport of CL 749660. It isn't a simple cherry pick because
there was a refactor at tip.
Fixes #77838
diff --git a/src/cmd/compile/internal/bloop/bloop.go b/src/cmd/compile/internal/bloop/bloop.go
index 69c889e..b8ff1f0 100644
--- a/src/cmd/compile/internal/bloop/bloop.go
+++ b/src/cmd/compile/internal/bloop/bloop.go
@@ -144,7 +144,7 @@
if name != nil {
debugName(name, n.Pos())
ret = keepAliveAt([]ir.Node{name}, n)
- } else if deref := n.X.(*ir.StarExpr); deref != nil {
+ } else if deref, ok := n.X.(*ir.StarExpr); ok && deref != nil {
ret = keepAliveAt([]ir.Node{deref}, n)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
@@ -159,7 +159,7 @@
if name != nil {
debugName(name, n.Pos())
ns = append(ns, name)
- } else if deref := lhs.(*ir.StarExpr); deref != nil {
+ } else if deref, ok := lhs.(*ir.StarExpr); ok && deref != nil {
ns = append(ns, deref)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
@@ -174,7 +174,7 @@
if name != nil {
debugName(name, n.Pos())
ret = keepAliveAt([]ir.Node{name}, n)
- } else if deref := n.X.(*ir.StarExpr); deref != nil {
+ } else if deref, ok := n.X.(*ir.StarExpr); ok && deref != nil {
ret = keepAliveAt([]ir.Node{deref}, n)
if base.Flag.LowerM > 1 {
base.WarnfAt(n.Pos(), "dereference will be kept alive")
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[release-branch.go1.26] cmd/compile: fix bloop test
Backport of CL 749660. It isn't a simple cherry pick because
there was a refactor at tip.
Fixes #77838
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |