Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@chriseth
Copy link
Contributor

@chriseth chriseth commented Aug 25, 2020

Fixes #9573

No tests are added because I was not able to reproduce the reported issue in 0.7.0.

// g(10)
// mstore(1, x_8)
// }
// function f(x)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The order functions are processed changed here: Now, first g is inlined into f. Then we take a look at g and do not inline the call to f anymore because it is directly recursive now.

Choose a reason for hiding this comment

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

Is the comment at the beginning of this file still relevant?
If it is, there is a typo there statemenst, might wanna fix that in this PR if the comment stays.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is still relevant.

@chriseth
Copy link
Contributor Author

I'll try adding a yul-only test.

@chriseth
Copy link
Contributor Author

Couldn't really come up with a test, but the change in the expectations at least show that this change has an effect.

@chriseth chriseth merged commit bc4e07d into develop Aug 26, 2020
@chriseth chriseth deleted the fixRecompilation branch August 26, 2020 14:39
Copy link

@leonardoalt leonardoalt left a comment

Choose a reason for hiding this comment

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

It looks good, but I'm still wondering whether there would be an even more resilient way to handle this.

// g(10)
// mstore(1, x_8)
// }
// function f(x)

Choose a reason for hiding this comment

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

Is the comment at the beginning of this file still relevant?
If it is, there is a typo there statemenst, might wanna fix that in this PR if the comment stays.

if (holds_alternative<Block>(statement))
handleBlock({}, std::get<Block>(statement));

// TODO it might be good to determine a visiting order:

Choose a reason for hiding this comment

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

Isn't this +- what this PR does now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This PR makes it less chaotic, but the TODO suggests that we should find an order that results in better code.

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.

Inconsistent bytecode created for identical contract input using standard-json compiler input

4 participants