]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.15] internal/poll: adjust ignoringEINTR to avoid slice escape
authorIan Lance Taylor <iant@golang.org>
Tue, 22 Sep 2020 00:05:11 +0000 (17:05 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 24 Sep 2020 19:57:55 +0000 (19:57 +0000)
commitfa01c8a14eeb760c58c5cd09afec327fdd392b2c
treeb691d490d5e2e44f7d87118221f316233e881be6
parentb1be1428dc7d988c2be9006b1cbdf3e513d299b6
[release-branch.go1.15] internal/poll: adjust ignoringEINTR to avoid slice escape

The 1.15 compiler is not quite smart enough to see that the byte slice
passed to ignoringEINTR does not escape. This ripples back up to user
code which would see a byte slice passed to os.(*File).Write escape,
which did not happen in 1.14.

Rather than backport some moderately complex compiler fixes, rewrite
the code slightly so that the 1.15 compiler is able to see that the
slice does not escape.

This is not a backport from tip, where the code is already different.
The test for this will be on tip, where we will most likely change the
compiler to understand this kind of code.

Fixes #41543
For #41474

Change-Id: I6c78164229fea7794e7edba512bfd7034a0b91c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/256418
Trust: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/internal/poll/fd_unix.go
src/runtime/trace/trace_stack_test.go