diff options
author | Bryce McKinlay <bryce@albatross.co.nz> | 2000-06-01 20:43:37 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2000-06-01 13:43:37 -0700 |
commit | 6518c7b51fe5df930c40168f785382335d55652b (patch) | |
tree | b8dfaa2a6c3118d993ed10b8c9c096c09ca64a03 /gcc/java | |
parent | ee418a779a36ce574061c95500e28a4f5381bc68 (diff) | |
download | gcc-6518c7b51fe5df930c40168f785382335d55652b.zip gcc-6518c7b51fe5df930c40168f785382335d55652b.tar.gz gcc-6518c7b51fe5df930c40168f785382335d55652b.tar.bz2 |
re GNATS gcj/127 (gcj dumps core on method invocation on a primitive type)
2000-05-23 Bryce McKinlay <bryce@albatross.co.nz>
* parse.y (patch_method_invocation): Don't try to lookup methods
in primitive types.
(This fixes the PR gcj/127:
http://sourceware.cygnus.com/ml/java-prs/2000-q1/msg00011.html)
From-SVN: r34347
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/java/parse.c | 10 | ||||
-rw-r--r-- | gcc/java/parse.y | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 9a3da82..de192e2 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -34,6 +34,11 @@ `wfl_operator', to maybe_build_primttype_type_ref. Fixes PR gcj/235. +2000-05-23 Bryce McKinlay <bryce@albatross.co.nz> + + * parse.y (patch_method_invocation): Don't try to lookup methods + in primitive types. + 2000-05-02 Alexandre Petit-Bianco <apbianco@cygnus.com> * parse.y (resolve_field_access): Call the appropriate <clinit> diff --git a/gcc/java/parse.c b/gcc/java/parse.c index c787183..fd547f2 100644 --- a/gcc/java/parse.c +++ b/gcc/java/parse.c @@ -12090,6 +12090,16 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl) 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); diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 385f913..2e6325e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9392,6 +9392,16 @@ patch_method_invocation (patch, primary, where, is_static, ret_decl) 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); |