changeset 1653:d114fa1cb4e6

[project @ 1995-12-20 08:37:01 by jwe]
author jwe
date Wed, 20 Dec 1995 08:37:09 +0000
parents c764beacdfb2
children d513745073fb
files src/symtab.cc
diffstat 1 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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