hyperledger-solang / solang

Solidity Compiler for Solana and Polkadot
https://solang.readthedocs.io/
Apache License 2.0
1.26k stars 210 forks source link

Fix type(int256).min in comparisons #1527

Closed seanyoung closed 1 year ago

seanyoung commented 1 year ago

When resolving comparisons, we don't know what the types of the operands are so we resolve with ResolveTo::Unknown. In this path, there is an mistake in the bounds check for negative integers.

Fixes https://github.com/hyperledger/solang/issues/1523