Skip to content

Conversation

GarmashAlex
Copy link
Contributor

  • MLOAD only reads from memory; it does not write to it. Including it in OpCode::modifies_memory misclassifies read-only behavior as memory-modifying.
  • Memory expansion (zero-filling) during reads is an allocation side effect, not a semantic write by the opcode itself. This aligns with interpreter implementations and EVM references.
  • Updated the test to expect false for MLOAD, kept MSTORE as modifying, and ADD as non-modifying.
  • This improves correctness for analyzers/inspectors relying on opcode classification and keeps consistency with other read-only ops (e.g., KECCAK256, RETURN) that also expand memory but aren’t flagged as modifying.

Copy link

codspeed-hq bot commented Sep 22, 2025

CodSpeed Performance Report

Merging #3004 will not alter performance

Comparing GarmashAlex:fix/opcode-modifies-memory-mload (880725a) with main (0fc5a4b)

Summary

✅ 173 untouched

Copy link
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

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

True mload does not change the memory.

@rakita rakita merged commit 82d2be1 into bluealloy:main Sep 24, 2025
31 checks passed
@github-actions github-actions bot mentioned this pull request Sep 24, 2025
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