microsoft / devicescript

TypeScript for Tiny IoT Devices (ESP32, RP2040, ...)
https://microsoft.github.io/devicescript/
MIT License
3.24k stars 113 forks source link

DeviceScript wrongly considers a loop as an infinite one. #697

Open xiboon opened 6 days ago

xiboon commented 6 days ago

Describe the bug DeviceScript panics, saying Exception: InfiniteLoop wrongly

To Reproduce

  1. create two random buffers, one of the size of 4500-5000 and the other with the size of 4
  2. loop over the big buffer, running bigBuffer[i] ^= smallBuffer[i % 4] in it
  3. see error

Expected behavior The loop runs and finishes successfully.

Screenshots image

Additional context I'm running through the devicescript simulator, experienced while creating a websocket library for devicescript. The loop is needed for masking the message.