-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Resolving Keccak-256: check if arguments are identifiers early. #11899
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
Conversation
3afe901
to
fbcdd75
Compare
fbcdd75
to
866a26b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, even though the changelog entry could be polished a bit.
866a26b
to
551ac81
Compare
Changelog.md
Outdated
@@ -12,6 +12,7 @@ Compiler Features: | |||
* SMTChecker: Add constraints to better correlate ``address(this).balance`` and ``msg.value``. | |||
* SMTChecker: Support the ``value`` option for external function calls. | |||
* Commandline Interface: Disallowed the ``--experimental-via-ir`` option to be used with Standard Json, Assembler and Linker modes. | |||
* Yul Optimizer: Fix a crash in LoadResolver, when ``keccak256`` had particular arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Yul Optimizer: Fix a crash in LoadResolver, when ``keccak256`` had particular arguments. | |
* Yul Optimizer: Fix a crash in LoadResolver when ``keccak256`` has non-identifier arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But not every non-identifier arguments? Maybe I'll change to "has particular non-identifier arguments"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it. Writing the changelog for this was more work than the fix :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comment about Changelog entry.
Previously, the check on whether the optimization was useful gas wise was done before checking if the keccak256 opcode had identifier as arguments. Since the gas meter crashes when encountering certain Yul opcodes (create, dataoffset, etc.), this optimizer step crashed.
551ac81
to
2cdd3b2
Compare
@@ -12,6 +12,7 @@ Compiler Features: | |||
* SMTChecker: Add constraints to better correlate ``address(this).balance`` and ``msg.value``. | |||
* SMTChecker: Support the ``value`` option for external function calls. | |||
* Commandline Interface: Disallowed the ``--experimental-via-ir`` option to be used with Standard Json, Assembler and Linker modes. | |||
* Yul Optimizer: Fix a crash in LoadResolver, when ``keccak256`` has particular non-identifier arguments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bugfix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shame on me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. Fixed in #11901
Previously, the check on whether the optimization was useful gas wise was done before checking if
the keccak256 opcode had identifier as arguments. Since the gas meter crashes when encountering
certain Yul opcodes (create2, dataoffset, etc.), this optimizer step crashed.
Closes #11803 and #11801