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

Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions #13028

Merged
merged 1 commit into from
May 20, 2022

Conversation

matheusaaguiar
Copy link
Collaborator

@matheusaaguiar matheusaaguiar commented May 16, 2022

(cherry picked from commit f567eb1)

This PR recreates #12861 on breaking, after it was reverted from develop in #13013.

Changelog.md Outdated Show resolved Hide resolved
@cameel
Copy link
Member

cameel commented May 17, 2022

Two of the CI failures seem to be coming from other PRs. For example negation.sol:

Expected result:
  TypeError 4907: (97-99): Unary operator - cannot be applied to type uint256: Unary negation is only allowed for signed integers.
Obtained result:
  TypeError 4907: (97-99): Unary operator - cannot be applied to type uint256. Unary negation is only allowed for signed integers.

This really weird. The test was added in #12828 and I remember that that PR had a last-minute change to replace the : with .. But the version with : was just changed in place. It was never merged into develop or breaking. Now this PR behaves as if it had :.

What'e ever weirder, I just checked state of TypeChecker.cpp as of this PR and there's clearly . there:

description += ". " + result.message();

So it's as if the binary used to run tests here was not built from the code at the right commit.

@cameel cameel changed the title Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks … Disallow RETURNDATASIZE and RETURNDATACOPY in inline assembly blocks in pure functions May 17, 2022
@cameel
Copy link
Member

cameel commented May 17, 2022

@matheusaaguiar I updated the description to link to the old PR. If your PR is directly related to some other PRs please try to always link to them. It helps a lot if, for whatever reason, you later need to go back and figure out what actually happened.

Also when github folds part of the title into the description, just put it back in the title. Or shorten it - whichever you prefer.

@cameel
Copy link
Member

cameel commented May 18, 2022

I took a closer look at history and I think that the extra failures are actual errors on breaking that probably have not been fixed after the last merge from develop.

The negation.sol change for example:

  • That change in TypeChecker.cpp was originally done on breaking in Disallow delete on types containing nested mappings. #11843. Back then it had : in the message.
  • Recently the same change was introduced on develop in Use error message for unary operators. #12828. I thought it was something completely new but now I realized that it must have just been cherry-picked from breaking.
    • I suggested a small tweak in that PR: we changed : to . as a fixup. That's why I was confused as to why : is still there. I thought that PR was the only thing changing that code and that we had : only in its initial version.
  • Later develop was merged into breaking and there must have been a conflict due to that tweak. I think it must have been resolved by taking TypeChecker.cpp from one PR but negation.sol from the other. Since such a merge usually triggers a wave of fail notifications, the fact that breaking was broken because of that was probably not noticed.

So, in short, these seem to be actual problems on breaking and should be fixed in a separate PR to breaking.

@matheusaaguiar matheusaaguiar force-pushed the disallow-returndatasize-returndatacopy branch 4 times, most recently from 98c282d to 7b66c80 Compare May 18, 2022 18:28
@ekpyron
Copy link
Member

ekpyron commented May 19, 2022

Since we said we want to have @wechman fix the test failures due to merging develop into breaking separately, I now merged #13041 - but this PR should now be fine again by rebasing and just dropping the test fixes that are unrelated to this PR from here, since they're now already in breaking.

@matheusaaguiar matheusaaguiar force-pushed the disallow-returndatasize-returndatacopy branch from 597cf63 to df19d35 Compare May 19, 2022 12:40
Copy link
Member

@ekpyron ekpyron left a comment

Choose a reason for hiding this comment

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

Looks good!

test/externalTests/ens.sh Outdated Show resolved Hide resolved
…in pure functions

(cherry picked from commit f567eb1)

quick fix to pass failing test at ./test/externalTests/ens.sh (line 80) -- Should be removed when 0.9 is released.
@matheusaaguiar matheusaaguiar force-pushed the disallow-returndatasize-returndatacopy branch from df19d35 to 7f4f655 Compare May 20, 2022 12:31
Copy link
Member

@cameel cameel left a comment

Choose a reason for hiding this comment

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

Looks good.

I'm going to merge this despite the failing ext test since it's unrelated and it might take some time before the fix gets merged into breaking.

@cameel cameel merged commit 777385f into breaking May 20, 2022
@cameel cameel deleted the disallow-returndatasize-returndatacopy branch May 20, 2022 15:01
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.

4 participants