Skip to content

bun:ffi: copy the TinyCC diagnostic into the error cc() throws - #38062

Open
robobun wants to merge 5 commits into
mainfrom
farm/02710624/ffi-tcc-error-message-uaf
Open

bun:ffi: copy the TinyCC diagnostic into the error cc() throws#38062
robobun wants to merge 5 commits into
mainfrom
farm/02710624/ffi-tcc-error-message-uaf

bun:ffi: shorten the comment on the copied diagnostic

72c1b86
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 13, 2026 in 20m 39s

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 test/js/bun/ffi/cc.test.ts:214-216 Test's exact-string 'unresolved' assertion fails on macOS due to TinyCC leading underscore

Annotations

Check failure on line 216 in test/js/bun/ffi/cc.test.ts

See this annotation in the file changed.

@claude claude / Claude Code Review

Test's exact-string 'unresolved' assertion fails on macOS due to TinyCC leading underscore

The exact-string `unresolved` assertion will fail on macOS: TinyCC sets `leading_underscore = 1` under `TCC_TARGET_MACHO`, so `put_extern_sym2` stores `_bun_test_missing_symbol` in the symtab and `relocate_syms` formats the diagnostic with the un-stripped name — the message on darwin is `unresolved reference to '_bun_test_missing_symbol'`. Either branch on `process.platform === 'darwin'` or relax to `expect.stringMatching(/'_?bun_test_missing_symbol'/)` (the PR already handles this convention fo