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

Some EOF-specific Yul builtin names are reserved even outside of EOF #15672

Open
cameel opened this issue Dec 20, 2024 · 0 comments
Open

Some EOF-specific Yul builtin names are reserved even outside of EOF #15672

cameel opened this issue Dec 20, 2024 · 0 comments
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. medium impact Default level of impact should compile without error Error is reported even though it shouldn't. Source is fine.
Milestone

Comments

@cameel
Copy link
Member

cameel commented Dec 20, 2024

Originally mentioned in #15559 (comment)

Description

The following identifiers recently started being treated as reserved in Yul: dataloadn, eofcreate, returncontract, rjump, rjumpi, callf, jumpf, retf. They should only be reserved on EOF. This is an unintentional change that was missed in #15456, #15550, #15547 and #15512.

This is a breaking change and must be reverted as soon as possible. Fortunately it did not make it into any released compiler version yet.

To verify that all opcodes are properly hidden outside of EOF, please create the tests I described in #15559 (comment).

Note that it's just the names that are reserved. The builtins themselves are not actually available outside of EOF (except for jumps, but this was already corrected in #15599).

Environment

  • Compiler version: 0.8.28 (develop)
  • Target EVM version (as per compiler settings): non-EOF

Steps to Reproduce

test.yul:

{
    function dataloadn() {}
    function eofcreate() {}
    function returncontract() {}
    function rjump() {}
    function rjumpi() {}
    function callf() {}
    function jumpf() {}
    function retf() {}
}
solc --strict-assembly test.yul
Error: The identifier "dataloadn" is reserved and can not be used.
 --> test.yul:2:5:
  |
2 |     function dataloadn() {}
  |     ^^^^^^^^^^^^^^^^^^^^^^^

Error: The identifier "eofcreate" is reserved and can not be used.
 --> test.yul:3:5:
  |
3 |     function eofcreate() {}
  |     ^^^^^^^^^^^^^^^^^^^^^^^

Error: The identifier "returncontract" is reserved and can not be used.
 --> test.yul:4:5:
  |
4 |     function returncontract() {}
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error: The identifier "rjump" is reserved and can not be used.
 --> test.yul:5:5:
  |
5 |     function rjump() {}
  |     ^^^^^^^^^^^^^^^^^^^

Error: The identifier "rjumpi" is reserved and can not be used.
 --> test.yul:6:5:
  |
6 |     function rjumpi() {}
  |     ^^^^^^^^^^^^^^^^^^^^

Error: The identifier "callf" is reserved and can not be used.
 --> test.yul:7:5:
  |
7 |     function callf() {}
  |     ^^^^^^^^^^^^^^^^^^^

Error: The identifier "jumpf" is reserved and can not be used.
 --> test.yul:8:5:
  |
8 |     function jumpf() {}
  |     ^^^^^^^^^^^^^^^^^^^

Error: The identifier "retf" is reserved and can not be used.
 --> test.yul:9:5:
  |
9 |     function retf() {}
  |     ^^^^^^^^^^^^^^^^^^
@cameel cameel added bug 🐛 should compile without error Error is reported even though it shouldn't. Source is fine. low effort There is not much implementation work to be done. The task is very easy or tiny. medium impact Default level of impact labels Dec 20, 2024
@cameel cameel added this to the 0.8.29 milestone Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. medium impact Default level of impact should compile without error Error is reported even though it shouldn't. Source is fine.
Projects
None yet
Development

No branches or pull requests

1 participant