From 8ff16c19909e5aecf51c6b993cba36ea51791f34 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Wed, 4 Aug 2021 19:41:19 -0400 Subject: [PATCH] runtime: accept restartable sequence pcdata values in isAsyncSafePoint 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 Run-TryBot: Cherry Mui Reviewed-by: Joel Sing Reviewed-by: Austin Clements --- src/runtime/preempt.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/preempt.go b/src/runtime/preempt.go index a38ab793986..334bac779ee 100644 --- a/src/runtime/preempt.go +++ b/src/runtime/preempt.go @@ -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).