Path: PR java/10253 (string concatenation with integer 0 constant)

Mohan Embar gnustuff@thisiscool.com
Wed Apr 9 14:25:00 GMT 2003


Hi Patch People,

This fixes PR java/10253 which Lars first reported here:

http://gcc.gnu.org/ml/java/2003-03/msg00376.html

Although this isn't platform-specific, I nevertheless tested
it with the i686-pc-linux-gnu and i386-pc-mingw32 native
compilers as well as the i686-pc-linux-gnu > i386-pc-mingw32
cross compiler.

I've attached my test case.

Off topic: I'll put out a new MingW build tonight which
incorporates this.

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/

ChangeLog
2003-04-09  Mohan Embar  <gnustuff@thisiscool.com>

	PR java/10253:
	* parse.y (string_convert_int_cst): Handle case
	where integer constant is exactly equal to 0.

Index: parse.y
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.405.2.8
diff -u -2 -r1.405.2.8 parse.y
--- parse.y	11 Mar 2003 20:34:40 -0000	1.405.2.8
+++ parse.y	9 Apr 2003 05:34:08 -0000
@@ -12692,4 +12692,9 @@
 
   *p-- = '\0';
+  if (!hi && !lo)
+  {
+    *p = '0';
+    return p;
+  }
 
   /* If negative, note the fact and negate the value.  */



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ZeroTest.tar.gz
Type: application/x-gzip
Size: 512 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20030409/0976560c/attachment.bin>


More information about the Gcc-patches mailing list