Skip to content

ICE when Yul sub-object name with a dot shadows the name of a nested object #13794

@cameel

Description

@cameel

Description

Sub-object names in Yul can contain dots. Dots are also used for accessing nested objects. If you try to do both at the same time so that the qualified name of a nested object matches another name that uses a dot, the compiler crashes with an ICE.

Steps to Reproduce

test.yul

object "A" {
    code {}

    object "B" {
        code {}

        object "C" {
            code {}
        }
    }

    object "B.C" {
        code {}
    }
}

Output

solc --strict-assembly test.yul
Uncaught exception:
/solidity/libyul/Object.cpp(99): Throw in function std::set<solidity::yul::YulString> solidity::yul::Object::qualifiedDataNames() const
Dynamic exception type: boost::wrapexcept<solidity::yul::YulAssertion>
std::exception::what: Yul assertion failed
[solidity::util::tag_comment*] = Yul assertion failed

Note that there is no crash if you move the definition B.C above B.

Environment

  • Compiler version: 0.8.17

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.low impactChanges are not very noticeable or potential benefits are limited.must have eventuallySomething we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions