OSDN Git Service

2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
authorapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Feb 2001 18:09:45 +0000 (18:09 +0000)
committerapbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Feb 2001 18:09:45 +0000 (18:09 +0000)
        * parse.y (process_imports): Save the original name of the import
        for better error report.

(http://gcc.gnu.org/ml/gcc-patches/2001-02/msg00250.html)

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39461 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 7b22997..23f5c30 100644 (file)
@@ -1,3 +1,8 @@
+2001-02-05  Alexandre Petit-Bianco  <apbianco@cygnus.com>
+
+       * parse.y (process_imports): Save the original name of the import
+       for better error report.
+
 2001-02-04  Bryce McKinlay  <bryce@albatross.co.nz>
 
        * Make-lang.in (jvspec.o): Add DRIVER_DEFINES to the list
index 33c868c..6ffa335 100644 (file)
@@ -6411,6 +6411,12 @@ process_imports ()
   for (import = ctxp->import_list; import; import = TREE_CHAIN (import))
     {
       tree to_be_found = EXPR_WFL_NODE (TREE_PURPOSE (import));
+      char *original_name;
+
+      obstack_grow0 (&temporary_obstack,
+                    IDENTIFIER_POINTER (to_be_found),
+                    IDENTIFIER_LENGTH (to_be_found));
+      original_name = obstack_finish (&temporary_obstack);
 
       /* Don't load twice something already defined. */
       if (IDENTIFIER_CLASS_VALUE (to_be_found))
@@ -6442,9 +6448,11 @@ process_imports ()
        {
          parse_error_context (TREE_PURPOSE (import),
                               "Class or interface `%s' not found in import",
-                              IDENTIFIER_POINTER (to_be_found));
-         return 1;
+                              original_name);
+         error_found = 1;
        }
+
+      obstack_free (&temporary_obstack, original_name);
       if (error_found)
        return 1;
     }