Commit deaf29a8 authored by Matthew Dempsky's avatar Matthew Dempsky
Browse files

cmd/compile: fix order-of-assignment issue w/ defers

CL 261677 fixed a logic issue in walk's alias detection, where it was
checking the RHS expression instead of the LHS expression when trying
to determine the kind of assignment. However, correcting this exposed
a latent issue with assigning to result parameters in functions with
defers, where an assignment could become visible earlier than intended
if a later expression could panic.

Fixes #43835.

Change-Id: I061ced125e3896e26d65f45b28c99db2c8a74a8c
Reviewed-on: https://go-review.googlesource.com/c/go/+/285633


Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarCuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: default avatarKeith Randall <khr@golang.org>
Trust: Matthew Dempsky <mdempsky@google.com>
parent ad2ca26a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment