aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r--gcc/java/parse.y7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 9c92e58..42f4206 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -2618,10 +2618,13 @@ java_pop_parser_context (generate)
next->incomplete_class = ctxp->incomplete_class;
next->gclass_list = ctxp->gclass_list;
lineno = ctxp->lineno;
- finput = ctxp->finput;
current_class = ctxp->current_class;
}
+ /* If the old and new lexers differ, then free the old one. */
+ if (ctxp->lexer && next && ctxp->lexer != next->lexer)
+ java_destroy_lexer (ctxp->lexer);
+
/* Set the single import class file flag to 0 for the current list
of imported things */
for (current = ctxp->import_list; current; current = TREE_CHAIN (current))
@@ -2661,7 +2664,6 @@ java_parser_context_save_global ()
else if (ctxp->saved_data)
create_new_parser_context (1);
- ctxp->finput = finput;
ctxp->lineno = lineno;
ctxp->current_class = current_class;
ctxp->filename = input_filename;
@@ -2675,7 +2677,6 @@ java_parser_context_save_global ()
void
java_parser_context_restore_global ()
{
- finput = ctxp->finput;
lineno = ctxp->lineno;
current_class = ctxp->current_class;
input_filename = ctxp->filename;