everx-labs / TVM-Solidity-Compiler

Solidity compiler for TVM
GNU General Public License v3.0
125 stars 72 forks source link

Segmentation fault: 11 for numbers more than 2**256 - 1 inside math.muldiv() #127

Closed FairyFromAlfeya closed 7 months ago

FairyFromAlfeya commented 1 year ago

Explanation:

code math.muldiv(2**256, 123, 2); throws runtime exception of solc

[ERROR] /bin/sh: line 1: 54600 Segmentation fault: 11 /Users/fairyfromalfeya/Library/Caches/locklift-nodejs/compiler/0_61_2/solc_0_61_2_darwin

Correct behavior:

The user will receive a compilation error with message like: first argument 2**256 is more than max possible value for uint256

IgorKoval commented 1 year ago

Thank you for reporting, we will solve it!