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.

@yearth
yearth force-pushed the codex/fix-buffer-from-island-diagnostic branch from a3dd28e to c09bdb5 Compare August 17, 2026 08:08
@yearth

yearth commented Aug 17, 2026

Copy link
Copy Markdown
Author

Refreshed this PR onto current main (a737fde); the patch is unchanged in scope, and main still does not contain an equivalent guard.

Validation on the refreshed commit (c09bdb5):

  • pnpm -r build
  • pnpm lint
  • diagnostics: 110/110 passed
  • order parity: 24/24 passed
  • SCRIPTC_TEST_WORKERS=4 pnpm test: 75 files passed, 3582 tests passed, 161 skipped
  • SCRIPTC_TEST_WORKERS=4 SCRIPTC_SAN=1 pnpm test: 75 files passed, 3582 tests passed, 161 skipped

pnpm test:sandbox could not start locally because SCRIPTC_SANDBOX_IMAGE is unavailable, so I used the repository-prescribed local fallback.

@yearth

yearth commented Aug 17, 2026

Copy link
Copy Markdown
Author

@ctate Hi! Just a gentle follow-up on this PR when you have a chance. I refreshed it onto the current main and reran build, lint, diagnostics, order parity, and both the plain and sanitizer full suites; everything passed. The change remains the same focused fix for #35, without expanding the supported Buffer.from surface.

Happy to adjust anything if you would prefer a different direction. Thanks for your time!

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