Repository navigation
Conversation
A fallible Void function that ends without `return` left the last value in rax (x0 on arm64). Callers read rax[63:32] as the error code, so any value with non-zero high bits looked like a raised error. Emit the same clear the explicit valueless return already uses on the ELF x86-64, Mach-O x86-64 and Mach-O arm64 fall-through paths. Add a runtime-required conformance fixture that covers empty, local, parameter, mutref-store and inferred-error-set bodies plus a genuine raise, and bump the emitter line budgets in compiler-metrics. Fixes vercel-labs#436 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@U0001F3A2 is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #436.
Problem
A fallible Void function that ends without
returnleft the last value inrax(x0on arm64). Callers readrax >> 32as the error code, so any leftover value with non-zero high 32 bits looked like a raised error. The explicit valueless return already clears it (emit_elf64.c:3899), but the fall-through path didn't.Fix
Emit the same clear on the fall-through path when
fun->raises, inemit_elf64.c,emit_macho_x64.candemit_macho64.c. The other backends rejectcheck/raisetoday, so they can't reach this path.conformance/native/pass/fallible-void-fallthrough.0covers an empty body, a local, a parameter (2^32 and -1), amutreffield store, an inferred error set, and a genuineraisethat must still propagate. It's registered withassertDirectRuntimeRequired.assertDirectRuntimeOrUnsupportedandrun_native_or_gapboth treat a non-zero exit as a backend gap, so neither could have caught this.The new lines push
emit_elf64.candemit_macho_x64.cpast theircompiler-metricsline budgets, so those are bumped to the new counts.Verification
assertDirectRuntimeRequiredbuild/run sequence exits 1 with no output on 7e1a64d, and printsfallible void fallthrough okwith this change. Each case also fails on its own without the fix.examples/fallibility,direct-raises-basic,direct-rescue-basic,checked-fallible-wrapper,world-output-helper) behave the same. No size budget or snapshot moves.compiler-metrics.mtsandgraph-input-policy.mtspass.pnpm run conformancelocally (no node 24 or pnpm here, and the musl runtime-linked builds need zig), so the full suite is down to CI.Not in this PR. ELF only skips the fall-through epilogue after
RETURN, while Mach-O also skips it afterRAISE, so ELF emits a deadxor; leave; retafter a trailingraise. It's harmless, and I left it alone to keep this small.🤖 Generated with Claude Code