Skip to content

fix: advance instruction index after CastLossy#29097

Open
radik878 wants to merge 2 commits intoProvableHQ:masterfrom
radik878:fix/castlossy-instruction-index
Open

fix: advance instruction index after CastLossy#29097
radik878 wants to merge 2 commits intoProvableHQ:masterfrom
radik878:fix/castlossy-instruction-index

Conversation

@radik878
Copy link
Contributor

@radik878 radik878 commented Feb 4, 2026

Motivation

The Aleo interpreter did not increment the instruction index after executing a CastLossy instruction. As a result, the same lossy cast could be re-executed indefinitely, effectively trapping the interpreter on that instruction.
Made CastLossy advance the instruction index in the same way as regular Cast, ensuring the Aleo instruction pointer progresses correctly after lossy casts.
Added a focused unit test that runs a tiny Aleo program containing a single cast.lossy instruction and asserts that the AleoExecution frame completes instead of looping, guarding against future regressions

Signed-off-by: radik878 <radikpadik76@gmail.com>
Signed-off-by: radik878 <radikpadik76@gmail.com>
@mohammadfawaz
Copy link
Collaborator

Thanks @radik878! Do you mind checking why your new test currently fails?

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