]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: handle some missing cases of non-SSAable values for args of open-coded...
authorDan Scales <danscales@google.com>
Mon, 28 Oct 2019 22:55:36 +0000 (15:55 -0700)
committerDan Scales <danscales@google.com>
Tue, 29 Oct 2019 19:58:24 +0000 (19:58 +0000)
commitcc47b0d2cd1c633f1a3c21632978d1180f65195f
tree5c0ba0d3788e1a9840985560aea7283652d14597
parent9f93fd225ffbafa2194303334b38c7db9ded3800
cmd/compile:  handle some missing cases of non-SSAable values for args of open-coded defers

In my experimentation, I had found that most non-SSAable expressions were
converted to autotmp variables during AST evaluation. However, this was not true
generally, as witnessed by issue #35213, which has a non-SSAable field reference
of a struct that is not converted to an autotmp. So, I fixed openDeferSave() to
handle non-SSAable nodes more generally, and make sure that these non-SSAable
expressions are not evaluated more than once (which could incorrectly repeat side
effects).

Fixes #35213

Change-Id: I8043d5576b455e94163599e930ca0275e550d594
Reviewed-on: https://go-review.googlesource.com/c/go/+/203888
Run-TryBot: Dan Scales <danscales@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
src/cmd/compile/internal/gc/ssa.go
src/runtime/defer_test.go