aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-05-08 00:29:43 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2007-05-08 00:29:43 +0000
commitdecc7c8a1cd784b2edeff50ee0f30572237b71f6 (patch)
tree868ce44f65955e02caefcb991f270db9d4bc43b7 /libjava
parent8df966ac78204dcad7452044fcaabdc7e3777602 (diff)
downloadgcc-decc7c8a1cd784b2edeff50ee0f30572237b71f6.zip
gcc-decc7c8a1cd784b2edeff50ee0f30572237b71f6.tar.gz
gcc-decc7c8a1cd784b2edeff50ee0f30572237b71f6.tar.bz2
re PR java/31842 (r124338 causes java Divide_1 and pr6388 to fail)
PR java/31842 * java/lang/natString.cc (_Jv_FormatInt): Avoid undefined signed overflow. From-SVN: r124530
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog6
-rw-r--r--libjava/java/lang/natString.cc8
2 files changed, 10 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 079c8e2..385e26d 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-07 Ian Lance Taylor <iant@google.com>
+
+ PR java/31842
+ * java/lang/natString.cc (_Jv_FormatInt): Avoid undefined signed
+ overflow.
+
2007-05-07 Keith Seitz <keiths@redhat.com>
* classpath/lib/gnu/classpath/jdwp/Jdwp.class: Regenerate.
diff --git a/libjava/java/lang/natString.cc b/libjava/java/lang/natString.cc
index 39590a3..f177c23 100644
--- a/libjava/java/lang/natString.cc
+++ b/libjava/java/lang/natString.cc
@@ -371,11 +371,11 @@ _Jv_FormatInt (jchar* bufend, jint num)
if (num < 0)
{
isNeg = true;
- num = -(num);
- if (num < 0)
+ if (num != (jint) -2147483648U)
+ num = -(num);
+ else
{
- // Must be MIN_VALUE, so handle this special case.
- // FIXME use 'unsigned jint' for num.
+ // Handle special case of MIN_VALUE.
*--ptr = '8';
num = 214748364;
}