]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: accept restartable sequence pcdata values in isAsyncSafePoint
authorCherry Mui <cherryyz@google.com>
Wed, 4 Aug 2021 23:41:19 +0000 (19:41 -0400)
committerCherry Mui <cherryyz@google.com>
Mon, 16 Aug 2021 23:32:14 +0000 (23:32 +0000)
If the pcdata value indicates a restartable sequence, it is okay
to asynchronously preempt (and resume at the restart PC). Accept
it in isAsyncSafePoint.

Fixes #47530.

Change-Id: I419225717c8eee5812f3235338262da5895aad0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/340011
Trust: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Joel Sing <joel@sing.id.au>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/preempt.go

index a38ab793986bd21ab13a8759f8ce5e52b21c7d2b..334bac779eec4b8627f8d6d9240aa219765f1ea9 100644 (file)
@@ -399,7 +399,7 @@ func isAsyncSafePoint(gp *g, pc, sp, lr uintptr) (bool, uintptr) {
                return false, 0
        }
        up, startpc := pcdatavalue2(f, _PCDATA_UnsafePoint, pc)
-       if up != _PCDATA_UnsafePointSafe {
+       if up == _PCDATA_UnsafePointUnsafe {
                // Unsafe-point marked by compiler. This includes
                // atomic sequences (e.g., write barrier) and nosplit
                // functions (except at calls).