argotorg / argotorg/solidity

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

Open
#13,794 0 comments 0 reactions 0 assignees View on GitHub
bug :bug: low effort low impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## 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`
```yul
object "A" {
code {}

object "B" {
code {}

object "C" {
code {}
}
}

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

### Output
```bash
solc --strict-assembly test.yul
```
```
Uncaught exception:
/solidity/libyul/Object.cpp(99): Throw in function std::set solidity::yul::Object::qualifiedDataNames() const
Dynamic exception type: boost::wrapexcept
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

Contributor guide

Open the contributing guide

Research direction

Reproduce the crash with the provided test.yul and solc --strict-assembly, then inspect solidity/libyul/Object.cpp around line 99, where the assertion is reported. Compare the failing B.C and nested B.C name cases, including their definition order. Done means the compiler handles the reproducer without an ICE and the regression is covered by the project's existing test approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.