]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re GNATS gcj/127 (gcj dumps core on method invocation on a primitive type)
authorBryce McKinlay <bryce@albatross.co.nz>
Thu, 1 Jun 2000 20:43:37 +0000 (20:43 +0000)
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>
Thu, 1 Jun 2000 20:43:37 +0000 (13:43 -0700)
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

gcc/java/ChangeLog
gcc/java/parse.c
gcc/java/parse.y

index 9a3da82207e6e92205687e911cdac513f4331724..de192e2f0f21ded617ca2000231b6afcf49170f7 100644 (file)
        `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>
index c7871837132fef209948272fd51f23b472a2f7a2..fd547f27768bd6129f324f21ac09214017ba3a4f 100644 (file)
@@ -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);
 
index 385f913968853881a90ace8103cd81b38f5cd892..2e6325e2e1c6663b5b4ea20f67e1ebaaa5776bfa 100644 (file)
@@ -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);