mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-03 10:37:46 +00:00
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:
@@ -31,7 +31,7 @@ func nanosecondsToTicks(ns int64) timeUnit {
|
||||
}
|
||||
|
||||
func sleepTicks(d timeUnit) {
|
||||
if d == 0 {
|
||||
if d <= 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user