diff options
author | Alexandre Petit-Bianco <apbianco@cygnus.com> | 2001-02-05 18:09:45 +0000 |
---|---|---|
committer | Alexandre Petit-Bianco <apbianco@gcc.gnu.org> | 2001-02-05 10:09:45 -0800 |
commit | 1ebb5e73d605d86d112619eae0fe94ca16eb7b86 (patch) | |
tree | 11533ee9a48313271ad4fc802cacfef2da5335d0 /gcc/java/parse.y | |
parent | 518fed76bc0e6ae59759d248e1717117921427e6 (diff) | |
download | gcc-1ebb5e73d605d86d112619eae0fe94ca16eb7b86.zip gcc-1ebb5e73d605d86d112619eae0fe94ca16eb7b86.tar.gz gcc-1ebb5e73d605d86d112619eae0fe94ca16eb7b86.tar.bz2 |
parse.y (process_imports): Save the original name of the import for better error report.
2001-02-05 Alexandre Petit-Bianco <apbianco@cygnus.com>
* 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)
From-SVN: r39461
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 33c868c..6ffa335 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -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; } |