ICU-6088 More complete overflow fix

X-SVN-Rev: 23827
This commit is contained in:
Jason Spieth 2008-04-24 20:42:46 +00:00
parent dc0ee6361a
commit 0dffb9ff54

View File

@ -686,7 +686,7 @@ SimpleDateFormat::parseGMT(const UnicodeString &text, ParsePosition &pos) const
if (pos.getErrorIndex() == -1 && pos.getIndex() > start) {
parsed.getArray(parsedCount);
if (parsedCount == 1 && parsed[0].getType() == Formattable::kDate) {
return (int32_t)(-1 * parsed[0].getDate());
return (int32_t)(-1 * (int64_t)parsed[0].getDate());
}
}
@ -699,7 +699,7 @@ SimpleDateFormat::parseGMT(const UnicodeString &text, ParsePosition &pos) const
if (pos.getErrorIndex() == -1 && pos.getIndex() > start) {
parsed.getArray(parsedCount);
if (parsedCount == 1 && parsed[0].getType() == Formattable::kDate) {
return (int32_t)parsed[0].getDate();
return (int32_t)((int64_t)parsed[0].getDate());
}
}
@ -725,7 +725,7 @@ SimpleDateFormat::parseGMT(const UnicodeString &text, ParsePosition &pos) const
if (pos.getErrorIndex() == -1 && pos.getIndex() > start) {
parsed.getArray(parsedCount);
if (parsedCount == 1 && parsed[0].getType() == Formattable::kDate) {
return (int32_t)parsed[0].getDate();
return (int32_t)((int64_t)parsed[0].getDate());
}
}