Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sstore and push in IR-base codegen cause bytes variable difference #15382

Open
Subway2023 opened this issue Sep 2, 2024 · 0 comments
Open

sstore and push in IR-base codegen cause bytes variable difference #15382

Subway2023 opened this issue Sep 2, 2024 · 0 comments
Labels

Comments

@Subway2023
Copy link

Description

After assigning and pushing to a bytes variable, the results of this variable differ between the code generated by legacy codegen and IR-based codegen.

Environment

  • Compiler version: 0.8.26
  • Target EVM version (as per compiler settings): None
  • Framework/IDE (e.g. Truffle or Remix): Remix
  • EVM execution environment / backend / blockchain client: None
  • Operating system: None

Steps to Reproduce

contract D {
    bytes otherData;
    function fromMemoryAndStorage() public{
        assembly { sstore(otherData.slot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00) }
        otherData.push();
    }
}

Legacy Codegen

storage:

0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff02

IR-based Codegen

storage:

0xff00000000000000000000000000000000000000000000000000000000000002

The IR-based codegen incorrectly cleared the value in the bytes variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant