diff libinterp/corefcn/interpreter.cc @ 24361:8bcfddad15ec

use shared_ptr to manage symbol_scope objects * symscope.h, symscope.cc (symbol_scope_rep): New class, renamed and adapted from symbol_scope. (symbol_scope): New class to manage symbol_scope_rep with shared_ptr. Change all uses of pointers ot symbol_scope objects to be symbol_scope objects or, in a few cases, pointers to symbol_scope_rep objects instead.
author John W. Eaton <jwe@octave.org>
date Mon, 27 Nov 2017 01:12:05 -0500
parents bc3819b7cca1
children c5c11b07598a
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter.cc	Tue Dec 05 11:35:11 2017 -0800
+++ b/libinterp/corefcn/interpreter.cc	Mon Nov 27 01:12:05 2017 -0500
@@ -539,12 +539,12 @@
   void interpreter::intern_nargin (octave_idx_type nargs)
   {
     // FIXME: should this explicitly be top_scope?
-    symbol_scope *scope = m_symbol_table.current_scope ();
+    symbol_scope scope = m_symbol_table.current_scope ();
 
     if (scope)
       {
-        scope->assign (".nargin.", nargs);
-        scope->mark_hidden (".nargin.");
+        scope.assign (".nargin.", nargs);
+        scope.mark_hidden (".nargin.");
       }
   }
 
@@ -1177,16 +1177,16 @@
     return m_url_handle_manager;
   }
 
-  symbol_scope *
+  symbol_scope
   interpreter::get_current_scope (void)
   {
     return m_symbol_table.current_scope ();
   }
 
-  symbol_scope *
+  symbol_scope
   interpreter::require_current_scope (const std::string& who)
   {
-    symbol_scope *scope = get_current_scope ();
+    symbol_scope scope = get_current_scope ();
 
     if (! scope)
       error ("%s: symbol table scope missing", who.c_str ());