uiua-lang / uiua

A stack-based array programming language
https://www.uiua.org
MIT License
1.62k stars 117 forks source link

Infinite sleep causes a panic in the interpreter #563

Closed thecaralice closed 1 month ago

thecaralice commented 1 month ago

Code:

⍜now(&sl∞)

Output:

The application panicked (crashed).
Message:  cannot convert float seconds to Duration: value is either too big or NaN
Location: /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/time.rs:957

Backtrace omitted.

Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
Error:
  The interpreter has crashed!
  Hooray! You found a bug!
  Please report this at http://github.com/uiua-lang/uiua/issues/new or on Discord at https://discord.gg/9CU2ME4kmn.

  Uiua version 0.13.0-dev.2

  code:
  inf-sleep.ua:1:6
  at inf-sleep.ua:1:6
1 | ⍜now(&sl∞)
         ───

Expected output: no output, program runs forever. Note: on the pad this program pushes the execution limit in seconds on the stack, running it multiple times like below gives the execution limit on the bottom of the stack and zeros on top of it

⍜now(&sl∞)⍜now(&sl∞)⍜now(&sl∞)
kaikalii commented 1 month ago

Fixed in 51c31d2e87383b1e450