Skip to content

Fix slice lowering to pass explicit end bounds to OP_SUBSTR#48

Merged
michaelsutton merged 1 commit intokaspanet:masterfrom
michaelsutton:fix/slice-substr-bounds-regression
Mar 6, 2026
Merged

Fix slice lowering to pass explicit end bounds to OP_SUBSTR#48
michaelsutton merged 1 commit intokaspanet:masterfrom
michaelsutton:fix/slice-substr-bounds-regression

Conversation

@michaelsutton
Copy link
Contributor

Fixes a compiler bug in ExprKind::Slice lowering where slice(start, end) was compiled as OP_SUBSTR(start, end - start) instead of OP_SUBSTR(start, end). The incorrect lowering caused invalid ranges and wrong slice lengths in runtime contracts (notably slice+concat reconstruction flows).

The PR includes:

@michaelsutton michaelsutton merged commit d5bb730 into kaspanet:master Mar 6, 2026
4 checks passed
@michaelsutton michaelsutton deleted the fix/slice-substr-bounds-regression branch March 6, 2026 01:09
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.

1 participant