mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-10 07:39:16 +00:00
ICU-12572 Fixing signed overflow in decimalquantity.
X-SVN-Rev: 41293
This commit is contained in:
parent
28e9f69378
commit
c9680037cc
1 changed files with 4 additions and 1 deletions
|
@ -328,7 +328,10 @@ bool DecimalQuantity::isZero() const {
|
|||
DecimalQuantity &DecimalQuantity::setToInt(int32_t n) {
|
||||
setBcdToZero();
|
||||
flags = 0;
|
||||
if (n < 0) {
|
||||
if (n == INT32_MIN) {
|
||||
flags |= NEGATIVE_FLAG;
|
||||
// leave as INT32_MIN; handled below in _setToInt()
|
||||
} else if (n < 0) {
|
||||
flags |= NEGATIVE_FLAG;
|
||||
n = -n;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue