Skip to content

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

@cameel

Description

@cameel

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() {}
  |     ^^^^^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.medium impactDefault level of impactshould compile without errorError is reported even though it shouldn't. Source is fine.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions