Skip to content

Commit

Permalink
runtime: skip negative sleep durations in sleepTicks
Browse files Browse the repository at this point in the history
sleepTicks calls machineLightSleep with the duration cast to an unsigned
integer. This underflow for negative durations.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
  • Loading branch information
eliasnaur authored and aykevl committed Apr 27, 2024
1 parent f986ea8 commit 50f700d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runtime/runtime_rp2040.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func nanosecondsToTicks(ns int64) timeUnit {
}

func sleepTicks(d timeUnit) {
if d == 0 {
if d <= 0 {
return
}

Expand Down

0 comments on commit 50f700d

Please sign in to comment.