# HG changeset patch # User jwe # Date 819448629 0 # Node ID d114fa1cb4e6221091787b5c2e15fded20aaf231 # Parent c764beacdfb2f621d02578eaeb07bc532296fb97 [project @ 1995-12-20 08:37:01 by jwe] diff -r c764beacdfb2 -r d114fa1cb4e6 src/symtab.cc --- a/src/symtab.cc Wed Dec 20 07:28:49 1995 +0000 +++ b/src/symtab.cc Wed Dec 20 08:37:09 1995 +0000 @@ -600,22 +600,27 @@ void symbol_record::pop_context (void) { - assert (! context.empty ()); - - if (is_variable ()) - { - symbol_def *old_def = pop_def (); - maybe_delete (old_def); - } + // It is possible for context to be empty if new symbols have been + // inserted in the symbol table during recursive calls. This can + // happen as a result of calls to eval() and feval(). - if (is_function ()) + if (! context.empty ()) { - symbol_def *old_def = pop_def (); - maybe_delete (old_def); + if (is_variable ()) + { + symbol_def *old_def = pop_def (); + maybe_delete (old_def); + } + + if (is_function ()) + { + symbol_def *old_def = pop_def (); + maybe_delete (old_def); + } + + definition = context.pop (); + linked_to_global = global_link_context.pop (); } - - definition = context.pop (); - linked_to_global = global_link_context.pop (); } int