diff options
author | Elias Naur <[email protected]> | 2024-04-26 16:18:56 +0200 |
---|---|---|
committer | Ayke <[email protected]> | 2024-04-27 09:52:44 +0200 |
commit | 50f700ddb58f4f920ddf3e377537ee545f26bb26 (patch) | |
tree | e970ee01675a4a88e31f02beab99c66790b192a5 | |
parent | f986ea84aca1420698da56667f57e69ec585530a (diff) | |
download | tinygo-50f700ddb58f4f920ddf3e377537ee545f26bb26.tar.gz tinygo-50f700ddb58f4f920ddf3e377537ee545f26bb26.zip |
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 <[email protected]>
-rw-r--r-- | src/runtime/runtime_rp2040.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime_rp2040.go b/src/runtime/runtime_rp2040.go index 8a8c343c5..fa048117b 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 } |