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

Add ControlFlowSideEffects parameter to createFunction in EVMDialect #15535

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

rodiazet
Copy link
Contributor

  • This is required by eof contract creation to set control flow side effect nicely .

Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@rodiazet rodiazet force-pushed the extend-create-function-interface branch 3 times, most recently from e2d3f5a to 6bb5518 Compare October 22, 2024 21:06
Comment on lines 316 to +319
SideEffects::Write, // memory
SideEffects::None // transientStorage
},
ControlFlowSideEffects::fromInstruction(evmasm::Instruction::CODECOPY),
Copy link
Member

Choose a reason for hiding this comment

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

I wanted to suggest to use EVMDialect::sideEffectsOfInstruction(evmasm::Instruction::CODECOPY) for SideEffects here too, but apparently the movableApartFromEffects flag here differs from what SemanticInformation::movableApartFromEffects() returns for this instruction.

The discrepancy Looks like a bug to me and confirms that we should be getting these values from SemanticInformation as a single source of truth instead of repeating them. Unless this case is actually intentional? @ekpyron?

Copy link
Member

Choose a reason for hiding this comment

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

I'm only seeing this now - it shouldn't actually make a difference in this case, but yeah, we can use the SemanticInformation version instead.

Copy link
Member

Choose a reason for hiding this comment

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

(as in, we probably should, the fact that it doesn't make a difference is more of a happy accident than intent here)

Copy link
Member

Choose a reason for hiding this comment

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

Good. Here's a PR that fixes it: #15556.

Turns out that the flag was randomly flipped in a refactor: #9283 (comment). Chris actually discovered that and requested a change, and it was marked as resolved, but the fix was apparently never applied before the PR was merged.

Fortunately looks like the value of this flag does not change anything for instructions that write to memory and this is the case here, so nothing was actually broken.

@cameel cameel enabled auto-merge October 23, 2024 18:34
@cameel
Copy link
Member

cameel commented Oct 23, 2024

I'd merge this one already, but apparently github has not noticed that CI passed after I reran it. Maybe try force pushing it to retrigger the checks (after amending it without changes just to alter the commit hash and make it look like a new one).

auto-merge was automatically disabled October 24, 2024 09:21

Head branch was pushed to by a user without write access

@rodiazet rodiazet force-pushed the extend-create-function-interface branch from 063b5be to cbb604e Compare October 24, 2024 09:21
@cameel cameel merged commit a83ea40 into ethereum:develop Oct 24, 2024
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants