Skip to content

runtime: fix panic if newstack at runtime.acquireLockRank #40844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/runtime/lockrank_off.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,29 @@ func getLockRank(l *mutex) lockRank {
return 0
}

// The following functions may be called in nosplit context.
// Nosplit is not strictly required for lockWithRank, unlockWithRank
// and lockWithRankMayAcquire, but these nosplit annotations must
// be kept consistent with the equivalent functions in lockrank_on.go.

//go:nosplit
func lockWithRank(l *mutex, rank lockRank) {
lock2(l)
}

//go:nosplit
func acquireLockRank(rank lockRank) {
}

//go:nosplit
func unlockWithRank(l *mutex) {
unlock2(l)
}

//go:nosplit
func releaseLockRank(rank lockRank) {
}

//go:nosplit
func lockWithRankMayAcquire(l *mutex, rank lockRank) {
}