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

Reassigning the memory free pointer does not cause an error. #272

Open
Subway2023 opened this issue Feb 25, 2025 · 2 comments · May be fixed by #277
Open

Reassigning the memory free pointer does not cause an error. #272

Subway2023 opened this issue Feb 25, 2025 · 2 comments · May be fixed by #277
Labels
bug Something isn't working

Comments

@Subway2023
Copy link

contract TestMStore {
    function testFunction() public pure returns (uint256) {
        uint256 result;
        assembly {
            let value := 42
            mstore(0x40, value)
            result := mload(0x40)
        }
        return result;
    }
}

solc+evm: execution error
solc(viaIR)+evm: execution is normal
zksolc+era_test_node: execution is normal

I believe this difference is due to zksolc compiling from Yul. Therefore, this difference needs to be reflected in the documentation.

@Subway2023 Subway2023 added the bug Something isn't working label Feb 25, 2025
@hedgar2017
Copy link
Collaborator

@Subway2023 yes, Yul is still our default codegen. It is mentioned in zksolc docs here: https://matter-labs.github.io/era-compiler-solidity/latest/02-command-line-interface.html#--codegen

Let me see. Perhaps, we can finally switch our default codegen to EVM assembly.

@hedgar2017
Copy link
Collaborator

@Subway2023 the recent versions of zksolc produce a warning for codegen:

Warning: The `codegen` setting will become mandatory in future versions of zksolc. Please set it to either `evmla` or `yul`

It is not verbose enough and doesn't explain what is our default and why.

We will make it more informative and keep it for a few months before converting to a hard error.

@hedgar2017 hedgar2017 reopened this Feb 25, 2025
@hedgar2017 hedgar2017 linked a pull request Feb 26, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants