]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: fix bug in defer wrapping
authorThan McIntosh <thanm@google.com>
Thu, 22 Apr 2021 22:34:57 +0000 (18:34 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 23 Apr 2021 01:16:19 +0000 (01:16 +0000)
commitcfac62a1cc021cae55c9c5e373ebe9c408b75a5d
tree9ab4415ffde640fa4f819f4983edf3de63218550
parent14056d0d004489592ee0173e685ff86f241cfb4f
cmd/compile: fix bug in defer wrapping

The defer wrapping feature added to the compiler's "order" phase
creates temporaries into which it copies defer arguments. If one of
these temps is large enough that we place it into the defer closure by
address (as opposed to by value), then the temp in question can't be
reused later on in the order phase, nor do we want a VARKILL
annotation for it at the end of the current block scope.

Test written by Cherry.

Updates #40724.

Change-Id: Iec7efd87ec5a3e3d7de41cdcc7f39c093ed1e815
Reviewed-on: https://go-review.googlesource.com/c/go/+/312869
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/walk/order.go
test/abi/wrapdefer_largetmp.go [new file with mode: 0644]
test/abi/wrapdefer_largetmp.out [new file with mode: 0644]