From 50f700ddb58f4f920ddf3e377537ee545f26bb26 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 26 Apr 2024 16:18:56 +0200 Subject: [PATCH] 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 --- src/runtime/runtime_rp2040.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/runtime_rp2040.go b/src/runtime/runtime_rp2040.go index 8a8c343c58..fa048117b9 100644 --- a/src/runtime/runtime_rp2040.go +++ b/src/runtime/runtime_rp2040.go @@ -31,7 +31,7 @@ func nanosecondsToTicks(ns int64) timeUnit { } func sleepTicks(d timeUnit) { - if d == 0 { + if d <= 0 { return }