Skip to content

fix(rt): handle SingletonArray+Field(0)+ConstantIndex(0) in traversal#988

Open
Stevengre wants to merge 2 commits intomasterfrom
jh/close-account-multisig-write-volatile-array
Open

fix(rt): handle SingletonArray+Field(0)+ConstantIndex(0) in traversal#988
Stevengre wants to merge 2 commits intomasterfrom
jh/close-account-multisig-write-volatile-array

Conversation

@Stevengre
Copy link
Contributor

@Stevengre Stevengre commented Mar 16, 2026

Fixes stuck execution in std::ptr::write_volatile::<[u8; 32]> caused by unhandled projectionElemSingletonArray in #traverseProjection.

The pointer cast *const Pubkey as *mut [u8; 32] produces the projection chain SingletonArray + Field(0) + ConstantIndex(0). This is semantically equivalent to just Field(0), so a single traversal rule cancels the triplet on single-element Aggregates.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: beef218f11

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Stevengre Stevengre marked this pull request as draft March 16, 2026 03:38
@Stevengre Stevengre force-pushed the jh/close-account-multisig-write-volatile-array branch 2 times, most recently from ca049dd to d232a5f Compare March 16, 2026 04:44
…napshot

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Stevengre Stevengre force-pushed the jh/close-account-multisig-write-volatile-array branch from d232a5f to 72cb233 Compare March 16, 2026 05:41
@Stevengre Stevengre changed the base branch from feature/p-token to master March 16, 2026 05:41
@Stevengre Stevengre force-pushed the jh/close-account-multisig-write-volatile-array branch 2 times, most recently from b057a45 to 490d167 Compare March 16, 2026 06:53
Add a traversal rule that eliminates the three-element projection chain
SingletonArray+Field(0)+ConstantIndex(0) on single-element Aggregates,
reducing it to just Field(0).

This pattern arises from pointer casts like `*const Pubkey as *mut [u8; 32]`
in write_volatile calls. The three projections together mean "treat the
struct as a one-element array, take field 0, index element 0" which is
equivalent to just "take field 0".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Stevengre Stevengre force-pushed the jh/close-account-multisig-write-volatile-array branch from 490d167 to 9afd294 Compare March 16, 2026 06:59
@Stevengre Stevengre changed the title fix(rt): normalize singleton-array volatile pubkey writes fix(rt): cancel SingletonArray+Field(0)+ConstantIndex(0) in traversal Mar 16, 2026
@Stevengre Stevengre changed the title fix(rt): cancel SingletonArray+Field(0)+ConstantIndex(0) in traversal fix(rt): handle SingletonArray+Field(0)+ConstantIndex(0) in traversal Mar 16, 2026
@Stevengre Stevengre requested review from dkcumming and mariaKt March 16, 2026 07:16
@Stevengre Stevengre marked this pull request as ready for review March 16, 2026 07:16
@Stevengre Stevengre self-assigned this Mar 16, 2026
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.

2 participants