Skip to content

fix: guard Buffer.from island arguments before bytesNew - #91

Open
yearth wants to merge 1 commit into
vercel-labs:mainfrom
yearth:codex/fix-buffer-from-island-diagnostic
Open

fix: guard Buffer.from island arguments before bytesNew#91
yearth wants to merge 1 commit into
vercel-labs:mainfrom
yearth:codex/fix-buffer-from-island-diagnostic

Conversation

@yearth

@yearth yearth commented Aug 4, 2026

Copy link
Copy Markdown

Fixes #35.

Summary

  • validate the actual lowered source IR before constructing bytesNew for Buffer.from
  • fall back to the existing SC2020 unsupported-shape diagnostic for island-backed Uint8Array and number[] values
  • add a dynamic regression fixture for both container branches and record its order-parity baseline

This preserves the currently supported Buffer.from surface; it only prevents an invalid jsval source from reaching bytesNew.

Testing

  • pnpm -r build
  • pnpm lint
  • pnpm exec vitest run tests/harness/diagnostics.test.ts (101 passed)
  • pnpm exec vitest run packages/compiler/test/ts7/order-parity.test.ts (23 passed)
  • SCRIPTC_TEST_WORKERS=4 pnpm test (3348 passed, 54 skipped)
  • SCRIPTC_TEST_WORKERS=4 SCRIPTC_SAN=1 pnpm test (3345 passed, 54 skipped, 3 parallel timeouts; all three passed in a single-worker targeted rerun)

@vercel

vercel Bot commented Aug 4, 2026

Copy link
Copy Markdown

@yearth is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

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.

SC9001 internal compiler error on Buffer.from(<island call>) where new Uint8Array(...) reports cleanly

1 participant