Repository navigation
Conversation
Contributor
Author
|
#1450 appeared while I was verifying this fix for #1449 and contains the same production guard. Closing this duplicate so there is only one merge candidate. The verified regression in b050ac4 additionally checks that the NUL name fails specifically with ENOENT (2), while preserving the existing prototype-key cases. The same commit documents exact-key lookup. Those pieces can be reused in #1450 if useful. Our actual emitted C, Bun 1.3.13, and Node 22.23.1 consumers confirmed the original Node-only prefix lookup and the corrected failure; the existing valid/missing-name case also passed on all three. No compiler, checker, gate, or cap changes. |
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.
Closes #1449.
Change
Reject NUL-containing names in
get_env.jsbefore the own-property lookup. Node's environment proxy truncates these names even inObject.hasOwn; relying on that check alone reads the variable before the NUL. Native C already rejects the name with ENOENT, and Bun already treats it as absent.Extend the existing
get_env_own.bendregression withHOME\0suffixand assert ENOENT, not just any failure. The existing environment fixtures already require HOME to be set; no value is printed or pinned. Prototype-only keys remain rejected. Document exact-name semantics in the existing BendRT paper.No valid-key/value changes, FFI portability changes, compiler/checker changes, or protected gate/cap edits.
Observed verification
Linux, Node 22.23.1, CLI Bun 1.3.13:
nul=error:2; Node incorrectly printsnul=set. Exact HOME lookup succeeds on all three.nul=error:2on Bun and Node; native behavior is unchanged.HOME_NUL=set, failing its expected output. After: C, Bun and Node each print the exact three expected lines (toString=unset,hasOwnProperty=unset,HOME_NUL=unset).bun gates/repo.ts: PASS: 54 / 54.Local qualification only; no mini-cluster gate claim. This effect does not use
bun:ffi, and its Node consumer is an actual emitted program, not a direct mock of the effect.