This is the mail archive of the
java-prs@sourceware.cygnus.com
mailing list for the Java project.
Re: gcj/127: gcj dumps core on method invocation on a primitive type
- To: apbianco at cygnus dot com
- Subject: Re: gcj/127: gcj dumps core on method invocation on a primitive type
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: 23 May 2000 12:30:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Bryce McKinlay <bryce at albatross dot co dot nz>
The following reply was made to PR gcj/127; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: joerg.brunsmann@fernuni-hagen.de
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/127: gcj dumps core on method invocation on a primitive type
Date: Wed, 24 May 2000 00:23:06 +1200
This is a multi-part message in MIME format.
--------------08B5E1309CA34344A4E98C68
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
I wrote a patch for this.
regards
[ bryce ]
--------------08B5E1309CA34344A4E98C68
Content-Type: text/plain; charset=us-ascii;
name="gcj-prim_invoke.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="gcj-prim_invoke.patch"
2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
* parse.y (patch_method_invocation): Don't try to lookup methods
in primitive types.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.168
diff -u -r1.168 parse.y
--- parse.y 2000/05/20 22:38:05 1.168
+++ parse.y 2000/05/23 12:15:44
@@ -9322,6 +9322,16 @@
type = GET_SKIP_TYPE (resolved);
resolve_and_layout (type, NULL_TREE);
+
+ if (JPRIMITIVE_TYPE_P (type))
+ {
+ parse_error_context
+ (identifier_wfl,
+ "Can't invoke a method on primitive type `%s'",
+ IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
+ PATCH_METHOD_RETURN_ERROR ();
+ }
+
list = lookup_method_invoke (0, identifier_wfl, type, identifier, args);
args = nreverse (args);
--------------08B5E1309CA34344A4E98C68--