Skip to content

console: guard AggregateError .errors recursion (cycle, depth, tampered property) - #35825

Closed
robobun wants to merge 11 commits into
mainfrom
farm/6e616f86/aggregate-error-cycle-guard
Closed

console: guard AggregateError .errors recursion (cycle, depth, tampered property)#35825
robobun wants to merge 11 commits into
mainfrom
farm/6e616f86/aggregate-error-cycle-guard

console: gate .errors iteration on pending exception only, not format…

de1b576
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 26, 2026 in 33m 49s

Code review found 1 potential issue

Found 4 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/VirtualMachine.rs:4893-4899 Post-for_each !formatter.failed guard leaks non-RangeError exceptions on can_throw=false sinks

Annotations

Check warning on line 4899 in src/jsc/VirtualMachine.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Post-for_each !formatter.failed guard leaks non-RangeError exceptions on can_throw=false sinks

The post-`for_each` `!formatter.failed` guard has the same sticky-flag over-reach on `can_throw_stack_overflow=false` sinks that de1b576b fixed for the pre-gate: after a deep sibling latches `formatter.failed=true` at L5574 (no throw on this sink), a following sibling whose `.errors` iterator genuinely throws returns `Err` here, `!formatter.failed` is false, and `clear_exception()` is skipped — leaving the thrown exception pending on the VM through `run_error_handler` → `process_exit` (asserts u