mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fixes issue where computing storage size for a number would take too long.
Fixes #4673.
This commit is contained in:
@@ -1263,7 +1263,8 @@ shared_ptr<FixedPointType const> RationalNumberType::fixedPointType() const
|
||||
return shared_ptr<FixedPointType const>();
|
||||
// This means we round towards zero for positive and negative values.
|
||||
bigint v = value.numerator() / value.denominator();
|
||||
if (negative)
|
||||
|
||||
if (negative && v != 0)
|
||||
// modify value to satisfy bit requirements for negative numbers:
|
||||
// add one bit for sign and decrement because negative numbers can be larger
|
||||
v = (v - 1) << 1;
|
||||
|
||||
Reference in New Issue
Block a user