[Yul optimizer] Name simplifier generates invalid yul code
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
```
{
function f(x1,x2,x3,x4,x5,x6,x7,x8,x9,x10,x11,x12,x13,x14,x15,x16,x17,x18,x19,x20,x21,x22,x23)
->
o1,o2,o3,o4,o5
{
o1 := call(msize(),0, 0, 0, 0, 0, 0)
}
let z1,z2,z3,z4,z5
:=
f(0,sload(4),0,sload(32),calldataload(9),sload(0),calldataload(2),sload(8),calldataload(2),sload(96),calldataload(0),sload(2),calldataload(88),sload(3),calldataload(6),sload(1),calldataload(4),sload(8),calldataload(32),sload(9),calldataload(0),sload(2),calldataload(8))
sstore(38,8)
let x11,_1,x68,_3,x._
:=
f(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
for{let i_0}lt(i_0,60){i_0:=add(i_0,20)}{ continue }
}
```
throws via
https://github.com/ethereum/solidity/blob/1fbee8259aca10ffe04efa47a21f31d7dee1baa9/libyul/optimiser/StackCompressor.cpp#L260
Contributor guide
Research direction
Start with the reproducing Yul input in the issue and inspect libyul/optimiser/StackCompressor.cpp around line 260, where the failure is reported. Determine why the name simplifier produces invalid Yul or triggers the stack compressor, then verify that this input no longer throws and generates valid code.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- blockchain, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100