fix(runtime): typed-array own-property fallback shadows secret-key buffer metadata (#4363 regression)#4399
Merged
Merged
Conversation
…et-key buffer metadata #4363 (typed array own properties) added a typed-array own-property block at the top of js_object_get_field_by_name that, for a Uint8Array-backed buffer, returns undefined for any key it doesn't recognize. A KeyObject's secret-key backing buffer is a Uint8Array, so its type / symmetricKeySize / asymmetricKey* metadata (resolved by the KeyObject block later in the same function) was shadowed and read back as undefined — a deterministic regression that fails the secret_key_buffer_metadata_survives_ic_miss_for_aes_sizes unit test on main (and every PR's cargo-test). Fix: fall through to the metadata block for a secret-key buffer instead of returning the typed-array undefined fallback. Plain typed arrays are unchanged (still return undefined for unknown keys). cargo test -p perry-runtime --lib: 979 passed, 0 failed (was 1 failed).
proggeramlug
added a commit
that referenced
this pull request
Jun 4, 2026
Mark harmonyos/ink smokes continue-on-error; re-tag from main with the #4399 AES fix. See CHANGELOG v0.5.1122.
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.
Summary
Main regression fix.
#4363(typed array own properties) added a typed-array own-property block at the top ofjs_object_get_field_by_namethat, for aUint8Array-backed buffer,return JSValue::undefined()for any key it doesn't recognize. AKeyObject's secret-key backing buffer is a Uint8Array, so itstype/symmetricKeySize/asymmetricKey*metadata — resolved by the KeyObject block later in the same function — was shadowed and read back asundefined.This is a deterministic failure on
mainHEAD (bisected to #4363): the unit testobject::field_get_set::buffer_ic_miss_tests::secret_key_buffer_metadata_survives_ic_miss_for_aes_sizesfails, which fails thecargo-testgate on every open PR.Fix
Fall through to the KeyObject metadata block for a secret-key buffer instead of returning the typed-array
undefinedfallback. Plain typed arrays are unchanged (still returnundefinedfor unknown keys).Validation
cargo test --release -p perry-runtime --lib: 979 passed, 0 failed (was 979 passed, 1 failed). The AES test passes both alone and in the full suite.Found while diagnosing why an unrelated PR's
cargo-testwas red — the failure was this pre-existing main regression, not that PR.