argotorg / argotorg/solidity

[Assembler] ICE due to invalid deposit

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

Description

```
library L {
function f0(int8 i0) public {
assembly {
codecopy(add(0x0,mod(3, 4)),7, mod(i0,1))
function af0(i1, i2, i3, i4) ->
o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15, o16, o17
{}
}
}
}
```

throws

https://github.com/ethereum/solidity/blob/311b2054afae02bfaa8521fd94475a06e0669025/libevmasm/Assembly.h#L108

Repro

```
$ solc --ir-optimized test.sol --asm --optimize
Uncaught exception:
/solidity/libevmasm/Assembly.h(108): Throw in function void solidity::evmasm::Assembly::adjustDeposit(int)
Dynamic exception type: boost::wrapexcept
std::exception::what: InvalidDeposit
[solidity::util::tag_comment*] = Assertion failed
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the provided Solidity source and the `solc --ir-optimized test.sol --asm --optimize` command. Start at `libevmasm/Assembly.h:108`, where `Assembly::adjustDeposit` throws `InvalidDeposit`; done means this input no longer causes an uncaught exception.

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
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.