Skip to content

Fix unchecked overflow in legacy codegen array size computation#16481

Open
r0qs wants to merge 1 commit intodevelopfrom
fix-unchecked-mul-storage-array-clear
Open

Fix unchecked overflow in legacy codegen array size computation#16481
r0qs wants to merge 1 commit intodevelopfrom
fix-unchecked-mul-storage-array-clear

Conversation

@r0qs
Copy link
Member

@r0qs r0qs commented Feb 18, 2026

This PR fixes an unchecked multiplication overflow in ArrayUtils::convertLengthToSize() that could cause delete to silently skip storage clearing when length * storageSize wraps modulo 2^256, leaving stale data in storage.

The correct behavior is to revert (as done in the IR pipeline), because clearing 2^256 slots is fundamentally impossible within gas limits. A delete that returns success but leaves data uncleared is incorrect.

Legacy evmasm codegen now uses overflowCheckedIntMulFunction, matching via-ir behavior.

@r0qs r0qs force-pushed the fix-unchecked-mul-storage-array-clear branch 2 times, most recently from 3aefba0 to 8dabc96 Compare February 18, 2026 17:48
@r0qs r0qs self-assigned this Feb 19, 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.

1 participant

Comments