argotorg / argotorg/solidity

False negative `Warning: Unreachable code.` in inline assembly

Open
#13,670 1 comment 2 reactions 1 assignee Claimed by @rodiazet View on GitHub
bug :bug: low effort medium impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

The code in [1] issues the warning in [2], which is not true since the function is called.

[1]
```solidity
contract C {
function f(uint) external pure returns (uint) {
assembly {
mstore(0, id(calldataload(4)))
return (0, 32)

function id(x) -> y {
y := x
}
}
}
}
```

[2]
```bash
Warning: Unreachable code.
--> contracts/3_Ballot.sol:7:13:
|
7 | function id(x) -> y {
| ^ (Relevant source part starts here and spans across multiple lines)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.