argotorg / argotorg/solidity

[Codegen] Recursive fallback function call runs out of gas via legacy but does not via IR

Open
#13,216 13 comments 0 reactions 0 assignees View on GitHub
bug :bug: codegen error high impact needs investigation viair
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.