[go] cmd/compile: fix mis-compilation when switching over channels

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Jul 3, 2024, 2:07:29 PM (2 days ago) Jul 3
to Cuong Manh Le, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Keith Randall, Keith Randall, Go LUCI, Than McIntosh, Cherry Mui, David Chase, Jorropo, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
cmd/compile: fix mis-compilation when switching over channels

CL 418101 changes Unified IR writer to force mixed tag/case to have
common type, emitting the implicit conversion if any of the case values
are not assignable to the tag value's type.

However, the Go spec definition of equality is non-transitive for
channels stored in interfaces, causing incorrect behavior with channel
values comparison.

To fix it, don't emit the implicit conversions if tag type is channel.

Fixes #67190
Change-Id: I9a29d9ce3c7978f0689e9502ba6f15660c763d16
Auto-Submit: Cuong Manh Le <cuong.m...@gmail.com>
Reviewed-by: Keith Randall <k...@google.com>
Reviewed-by: Keith Randall <k...@golang.org>
Reviewed-by: Than McIntosh <th...@google.com>
Files:
  • M src/cmd/compile/internal/noder/writer.go
  • A test/fixedbugs/issue67190.go
Change size: M
Delta: 2 files changed, 43 insertions(+), 7 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Keith Randall, +1 by Keith Randall, +2 by Than McIntosh
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: I9a29d9ce3c7978f0689e9502ba6f15660c763d16
Gerrit-Change-Number: 594575
Gerrit-PatchSet: 8
Gerrit-Owner: Cuong Manh Le <cuong.m...@gmail.com>
Gerrit-Reviewer: Cherry Mui <cher...@google.com>
Gerrit-Reviewer: Cuong Manh Le <cuong.m...@gmail.com>
Gerrit-Reviewer: David Chase <drc...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@golang.org>
Gerrit-Reviewer: Keith Randall <k...@google.com>
Gerrit-Reviewer: Than McIntosh <th...@google.com>
Gerrit-CC: Jorropo <jorro...@gmail.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages