Skip to content

Fix stack overflow when inspecting JSX elements with circular references - #29750

Closed
robobun wants to merge 1 commit into
mainfrom
farm/deb3abed/jsx-inspect-circular
Closed

Fix stack overflow when inspecting JSX elements with circular references#29750
robobun wants to merge 1 commit into
mainfrom
farm/deb3abed/jsx-inspect-circular

Fix stack overflow when inspecting JSX elements with circular references

902d52a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 26, 2026 in 4m 33s

Code review found 1 important issue

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

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important src/bun.js/ConsoleObject.zig:1139 Same JSX circular-reference stack overflow remains in JestPrettyFormat

Annotations

Check failure on line 1139 in src/bun.js/ConsoleObject.zig

See this annotation in the file changed.

@claude claude / Claude Code Review

Same JSX circular-reference stack overflow remains in JestPrettyFormat

The same crash still exists in the parallel jest pretty-formatter: `src/bun.js/test/pretty_format.zig:328-330` has its own `canHaveCircularReferences()` that still omits `.JSX`, and its `.JSX` branch recurses into `key`/`props`/`children` via `this.format()` with no stack-check fallback. After this PR, `expect(circularJsxEl).toMatchSnapshot()` or a failing `toEqual` diff (via `diff_format.zig`) will still segfault — the fuzzer crash is only half-fixed. The same one-line change should be mirrored