ICE in `ABIFunctions::abiDecodingFunctionArrayAvailableLength` when decoding a dynamic array with a zero-sized element type
- Dominant language
- C++
- Stars
- 25.7k
- Forks
- 6.2k
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 21
Description
The compiler panics with `Solidity assertion failed` in [`libsolidity/codegen/ABIFunctions.cpp:1173`](https://github.com/ethereum/solidity/blob/9be66192f9db40e5a43f71fc78e06b2f35e9ccdd/libsolidity/codegen/ABIFunctions.cpp#L1173) inside `abiDecodingFunctionArrayAvailableLength()` when `abi.decode` is used with a type of the form `T[0][]` — a dynamic array whose element type is a zero-length static array.
MRE:
```solidity
contract C { function f(bytes memory b) public pure { abi.decode(b, (uint256[0][])); } }
```
Reproduce: save as `mre.sol`, run `solc --bin mre.sol`.
Output:
```
Internal compiler error:
/solidity/libsolidity/codegen/ABIFunctions.cpp(1173): Throw in function std::string solidity::frontend::ABIFunctions::abiDecodingFunctionArrayAvailableLength(const solidity::frontend::ArrayType&, bool)
Dynamic exception type: boost::wrapexcept
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed
```
Expected behavior: a type error rejecting `uint256[0]` as an element type (zero-length static arrays are meaningless), or at minimum a graceful compile error from the ABI decoder.
Also reproduces with `int32[1][0][]` and other base types — any `T[0][]` pattern triggers it.
Git commit: 9be66192f
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++
Contributor guide
Research direction
Start in libsolidity/codegen/ABIFunctions.cpp at line 1173 and inspect abiDecodingFunctionArrayAvailableLength() while reproducing the issue with the provided mre.sol and solc --bin mre.sol command. Trace how T[0][] reaches the assertion, then verify compilation produces a graceful diagnostic rather than an internal compiler error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, solidity
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100