mirror of
https://github.com/golang/go
synced 2024-11-12 06:40:22 -07:00
runtime: fix saved PC/SP after safe-point function in syscall
Running a safe-point function on syscall entry uses systemstack() and hence clobbers g.sched.pc and g.sched.sp. Fix this by re-saving them after the systemstack, just like in the other uses of systemstack in reentersyscall. Change-Id: I47868a53eba24d81919fda56ef6bbcf72f1f922e Reviewed-on: https://go-review.googlesource.com/12125 Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
edfc979725
commit
e42413cecc
@ -1831,6 +1831,7 @@ func reentersyscall(pc, sp uintptr) {
|
||||
if _g_.m.p.ptr().runSafePointFn != 0 {
|
||||
// runSafePointFn may stack split if run on this stack
|
||||
systemstack(runSafePointFn)
|
||||
save(pc, sp)
|
||||
}
|
||||
|
||||
_g_.m.syscalltick = _g_.m.p.ptr().syscalltick
|
||||
|
Loading…
Reference in New Issue
Block a user