Skip to content

fix: typing for mixed-width sum whose left operand is narrower - #3104

Open
vbar wants to merge 1 commit into
crytic:masterfrom
vbar:mixed-width-typing
Open

vbar wants to merge 1 commit into
crytic:masterfrom
vbar:mixed-width-typing

Conversation

@vbar

@vbar vbar commented Sep 24, 2026

Copy link
Copy Markdown

Binary.__init__ typed the result of every arithmetic binary operation as left_variable.type, ignoring the right operand. Solidity implicitly widens mixed-width int/uint operands to their common (wider) type, so (a + b) should be typed uint256, not uint128. Because the temporary variable was mistyped as uint128, the using Lib for uint256 binding could not be resolved, LibraryCall.function was left None, and a later pass crashed with AttributeError: 'NoneType' object has no attribute 'parameters'.

Fixes #3103 .

@vbar
vbar requested a review from smonicas as a code owner September 24, 2026 12:25
@CLAassistant

CLAassistant commented Sep 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug-Candidate]: "Impossible to generate IR" when a using for library function is called on a mixed-width sum whose left operand is narrower

2 participants