changeset 23644:3177e276e60f

avoid inifite recursion in symbol table glob and regexp functions * symtab.h (symbol_table::glob_variables, symbol_table::regexp_variables): Avoid infinite recursion error from previous change.
author John W. Eaton <jwe@octave.org>
date Mon, 19 Jun 2017 12:02:37 -0400
parents 3dc16b35ba2c
children e553b7b2fe39
files libinterp/corefcn/symtab.h
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/symtab.h	Mon Jun 19 09:09:27 2017 -0700
+++ b/libinterp/corefcn/symtab.h	Mon Jun 19 12:02:37 2017 -0400
@@ -1383,11 +1383,14 @@
   {
     std::list<symbol_record> retval;
 
+    if (! m_current_scope)
+      return retval;
+
     size_t len = patterns.numel ();
 
     for (size_t i = 0; i < len; i++)
       {
-        std::list<symbol_record> tmp = glob_variables (patterns[i]);
+        std::list<symbol_record> tmp = m_current_scope->glob (patterns[i]);
 
         retval.insert (retval.begin (), tmp.begin (), tmp.end ());
       }
@@ -1399,11 +1402,14 @@
   {
     std::list<symbol_record> retval;
 
+    if (! m_current_scope)
+      return retval;
+
     size_t len = patterns.numel ();
 
     for (size_t i = 0; i < len; i++)
       {
-        std::list<symbol_record> tmp = regexp_variables (patterns[i]);
+        std::list<symbol_record> tmp = m_current_scope->regexp (patterns[i]);
 
         retval.insert (retval.begin (), tmp.begin (), tmp.end ());
       }