aboutsummaryrefslogtreecommitdiff
path: root/gcc/java
diff options
context:
space:
mode:
authorPer Bothner <per@bothner.com>2001-05-21 14:37:36 -0700
committerPer Bothner <bothner@gcc.gnu.org>2001-05-21 14:37:36 -0700
commit075516bcc608bac306728dd6d9dc1db20645fd37 (patch)
treee7282074e60548e4c280100cd1c5a737b9b3efb5 /gcc/java
parent4694cec254258d31576e9a1623ebeb1c777765cb (diff)
downloadgcc-075516bcc608bac306728dd6d9dc1db20645fd37.zip
gcc-075516bcc608bac306728dd6d9dc1db20645fd37.tar.gz
gcc-075516bcc608bac306728dd6d9dc1db20645fd37.tar.bz2
jcf-parse.c (read_class): If class is from .class or .zip file and it's already been read...
* jcf-parse.c (read_class): If class is from .class or .zip file and it's already been read, don't push/pop parser context. From-SVN: r42407
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/jcf-parse.c24
2 files changed, 19 insertions, 10 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 677d507..7b4c0e5 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2001-05-21 Per Bothner <per@bothner.com>
+
+ * jcf-parse.c (read_class): If class is from .class or .zip file
+ and it's already been read, don't push/pop parser context.
+
2001-05-18 Per Bothner <per@bothner.com>
* jvspec.c (lang_specific_pre_link): Re-arrange the linker
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index 4be3453..6127d9d 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -558,7 +558,6 @@ read_class (name)
tree save_current_class = current_class;
const char *save_input_filename = input_filename;
JCF *save_current_jcf = current_jcf;
- int generate;
if ((icv = IDENTIFIER_CLASS_VALUE (name)) != NULL_TREE)
{
@@ -579,14 +578,15 @@ read_class (name)
current_jcf = jcf;
- java_parser_context_save_global ();
- java_push_parser_context ();
if (current_jcf->java_source)
{
const char *filename = current_jcf->filename;
tree file;
FILE *finput;
+ int generate;
+ java_parser_context_save_global ();
+ java_push_parser_context ();
BUILD_FILENAME_IDENTIFIER_NODE (file, filename);
generate = IS_A_COMMAND_LINE_FILENAME_P (file);
if (wfl_operator == NULL_TREE)
@@ -605,24 +605,28 @@ read_class (name)
fatal_io_error ("can't close %s", input_filename);
}
JCF_FINISH (current_jcf);
+ java_pop_parser_context (generate);
+ java_parser_context_restore_global ();
}
else
{
- input_filename = current_jcf->filename;
- current_class = class;
if (class == NULL_TREE || ! CLASS_PARSED_P (class))
{
+ java_parser_context_save_global ();
+ java_push_parser_context ();
+ current_class = class;
+ input_filename = current_jcf->filename;
if (JCF_SEEN_IN_ZIP (current_jcf))
read_zip_member(current_jcf,
current_jcf->zipd, current_jcf->zipd->zipf);
jcf_parse (current_jcf);
+ class = current_class;
+ java_pop_parser_context (0);
+ java_parser_context_restore_global ();
}
- layout_class (current_class);
- load_inner_classes (current_class);
- generate = 0;
+ layout_class (class);
+ load_inner_classes (class);
}
- java_pop_parser_context (generate);
- java_parser_context_restore_global ();
current_class = save_current_class;
input_filename = save_input_filename;