ICE when applying function call syntax to single element tuples containing comptime builtins, errors or events
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reproducing the crash with the Solidity source in the issue, compiling with solc --bin and --bin --via-ir. Then inspect the mentioned ASTNode::referencedDeclaration usages and the listed paths in ASTUtils.cpp, ExpressionCompiler.cpp, and YulUtilFunctions::requireWithErrorFunction; done means the tuple-expression cases no longer trigger an internal compiler error across the shown examples and pipelines.
Written by the indexing model from the issue text.
Description
Description
ASTNode::referencedDeclaration usages do not handle properly an argument passed to the function which is a tuple expression. In this case the function returns nullptr, but in a couple of places in the code there is an assets checking that the returned values is not null.
Environment
- Compiler version: 0.8.37
- Compilation pipeline (legacy, IR, SSA CFG): legacy, IR, maybe more
- Target EVM version (as per compiler settings):
- Framework/IDE (e.g. Foundry, Hardhat, Remix):
- EVM execution environment / backend / blockchain client:
- Operating system:
Steps to Reproduce
Run solc passing file below as na input and flag --bin or --bin --via-ir
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.30;
library L {
error E(uint256);
}
contract C {
error E();
error EU(uint256);
// ASTUtils.cpp: erc7201CompileTimeValue
function erc7201Paren() public pure returns (uint256) {
return (erc7201)("abc");
}
function erc7201DoubleParen() public pure returns (uint256) {
return ((erc7201))("abc");
}
// Legacy: ExpressionCompiler.cpp; IR: YulUtilFunctions::requireWithErrorFunction
function requireParen(bool c) public pure {
require(c, (E)());
}
function requireParenWithArgs(bool c) public pure {
require(c, (EU)(1));
}
function requireDoubleParenWithArgs(bool c) public pure {
require(c, ((EU))(2));
}
function requireParenMemberAccess(bool c) public pure {
require(c, (L.E)(1));
}
}
-->
- Dominant language
- C++
- Stars
- 25.8k
- Forks
- 6.2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 43
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from argotorg/solidity
-
AI tool policy: add AGENTS.mdMay be free again @cameel claimed this 47 days ago, and no pull request is open. Opendocumentation :book:
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
argotorg/solidity#16996 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
`fitsPrecisionExp` charges the base's bit *length* per multiplication instead of its bit *position*, so valid constant powers such as `2 ** 2049` are rejectedPossibly taken @clonker claimed this 54 days ago. Openbug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
argotorg/solidity#16984 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
`0 ** (-1)` is silently evaluated to `0` in a constant expression instead of being rejected as division by zeroMay be free again @matheusaaguiar claimed this 54 days ago, and no pull request is open. Openbug :bug: low impact
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
argotorg/solidity#16982 · 3 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
AssemblyItem AssemblyItem::toSubAssemblyTag assumes size_t is at least 64bPossibly taken @riba2534 claimed this 67 days ago. Openbug :bug: low impact
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
FileReader: Duplicate search paths cause false ambiguous importsPossibly taken @zjuncal claimed this 3 days ago. Openbug :bug:
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in argotorg/solidity
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
KLayout/klayout#2554 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
LaneDibello/Kotor-Patch-Manager#375 ·
Maintainers usually reply within 2 days