runtime: skip negative sleep durations in sleepTicks

sleepTicks calls machineLightSleep with the duration cast to an unsigned
integer. This underflow for negative durations.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2024-04-26 16:18:56 +02:00
committed by Ayke
parent f986ea84ac
commit 50f700ddb5
+1 -1
View File
@@ -31,7 +31,7 @@ func nanosecondsToTicks(ns int64) timeUnit {
}
func sleepTicks(d timeUnit) {
if d == 0 {
if d <= 0 {
return
}