fix(codemode): cap script output so print loops cannot exhaust host memory

text(), image(), and console.* fail the script with a RangeError past
MAX_OUTPUT_CHARS (16 Mi) characters or MAX_OUTPUT_ITEMS (100000) items.

closes #10283
This commit is contained in:
Armin Ronacher 2026-10-02 17:53:52 +02:00
parent eeac84ca92
commit 319fecb89b
7 changed files with 72 additions and 7 deletions

View file

@ -2,6 +2,10 @@
## [Unreleased]
### Fixed
- Fixed scripts that print in a loop growing the host's memory until it crashes: output is limited to `MAX_OUTPUT_CHARS` (16 Mi) characters and `MAX_OUTPUT_ITEMS` (100000) items, and a script past either limit fails with a `RangeError` ([#10283](https://github.com/earendil-works/pi/issues/10283))
## [1.0.0] - 2026-10-01
### Added