[Codegen] Recursive fallback function call runs out of gas via legacy but does not via IR
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 29
Description
```
contract C0 {
fallback() external virtual
{
assembly
{
calldatacopy(0, not(0), 96)
}
(bool l0, bytes memory l1) = address(this).call(bytes("ffffffffffffffffffffffffffffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000"));
}
}
// ====
// compileViaYul: also
// ----
// () -> FAILURE
// gas irOptimized: 211360
```
Legacy: FAILURE
IR: Pass
Contributor guide
Research direction
Start with the provided C0 fallback reproducer and run the compileViaYul test to confirm the Legacy FAILURE versus IR Pass and gas difference. Trace the code-generation paths for the recursive fallback call, then verify that both paths produce the expected failure behavior for this contract.
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