Skip to content

fix(cli): only a stack overflow prints the stack overflow message (#2120) - #2122

Merged
nicolas-abril merged 2 commits into
bendlang:mainfrom
hhefesto:fix-2120-rangeerror-message
Nov 12, 2026
Merged

nicolas-abril merged 2 commits into
bendlang:mainfrom
hhefesto:fix-2120-rangeerror-message

Conversation

@hhefesto

Copy link
Copy Markdown
Contributor

Fixes #2120.

book_err in bend2/main.ts printed every RangeError as "the machine stack overflowed". JSC also throws RangeError for things that are not a full stack (Out of memory, an invalid array length, a BigInt too big), so 2.0.40's FL.ground blowup (#2076) read as a deep recursion, and raising the stack limit could not help. Now only "Maximum call stack size exceeded" prints the stack-overflow message. Any other RangeError prints its own text, as RangeError: Out of memory.

Checked

hhefesto and others added 2 commits November 10, 2026 20:23
…ndlang#2120)

book_err printed every RangeError as "the machine stack overflowed". JSC
throws RangeError for more than a full stack (Out of memory, an invalid
array length, a BigInt too big), so 2.0.40's FL.ground blowup (bendlang#2076) read
as a deep recursion. Now only "Maximum call stack size exceeded" prints that
message; any other RangeError prints its own, as "RangeError: Out of memory".

Checked: 2.0.40 with this change prints "RangeError: Out of memory" on a
program that bendlang#2107 fixed; bendlang#2093's deep.bend still prints the stack message;
the 550 tests whose expected output has an error print the same as main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…book_err and io_run (bendlang#2120)

The `/call stack/` test ran on every error that was not a Bend Err and
matched anywhere in its text, so a JS effect's `Error("... call stack
...")` printed as a stack overflow. book_err now asks for a RangeError
whose message starts with "Maximum call stack size exceeded". The JS
IO runtime's catch in comp.ts had the same bendlang#2120 bug (every RangeError
became "memory fault (machine stack overflow?)") and takes the same test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A RangeError that is not a stack overflow is reported as one

2 participants