]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: fix map assignment order
authorMatthew Dempsky <mdempsky@google.com>
Sun, 3 Jan 2021 08:16:46 +0000 (00:16 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Sun, 3 Jan 2021 19:48:18 +0000 (19:48 +0000)
commit907a4bfdc75004bc31c30564734cffc61ab1e80c
tree4841bd492cad24e52ce4b89e26c4d9672d0f58c9
parentf2e6dab04859a3211ce9f5bf5bac9edde0831ce1
[dev.regabi] cmd/compile: fix map assignment order

After the previous cleanup/optimization CLs, ascompatee now correctly
handles map assignments too. So remove the code from order.mapAssign,
which causes us to assign to the map at the wrong point during
execution. It's not every day you get to fix an issue by only removing
code.

Thanks to Cuong Manh Le for test cases and continually following up on
this issue.

Passes toolstash -cmp. (Apparently the standard library never uses
tricky map assignments. Go figure.)

Fixes #23017.

Change-Id: Ie0728103d59d884d00c1c050251290a2a46150f9
Reviewed-on: https://go-review.googlesource.com/c/go/+/281172
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/order.go
test/fixedbugs/issue23017.go [new file with mode: 0644]