comparison libinterp/corefcn/symscope.h @ 25201:c80323fe4938 stable

improve handling of global symbols (bug #53599) * load-save.cc (install_loaded_variable): For global values, check global status and link to global symbol if needed. * symrec.h (symbol_record::symbol_record_rep::unbind_global_rep): New function. (symbol_record::symbol_record_rep::clear): Use unbind_global_rep to clearing global symbols. (symbol_record::symbol_record_rep::is_marked_global): New function. (symbol_record::symbol_record_rep::is_global): Use it. (symbol_record::symbol_record_rep::bind_fwd_rep): Don't forward again if symbol is already global. (symbol_record::unbind_fwd_rep): Eliminate argument. Change all uses. (symbol_record::symbol_record_rep::unbind_fwd_rep): Eliminate argument. Simplify. * test/bug-53599.tst: New file. * test/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Tue, 10 Apr 2018 22:22:37 -0400
parents 078b795c5219
children 72ea868ca63a
comparison
equal deleted inserted replaced
25200:b3ee0179d7b0 25201:c80323fe4938
790 { 790 {
791 if (m_rep) 791 if (m_rep)
792 m_rep->mark_hidden (name); 792 m_rep->mark_hidden (name);
793 } 793 }
794 794
795 // This function should only be called for the global
796 // symbol_scope, and that should only happen when it is added to
797 // the global symbol_scope.
798
795 void mark_global (const std::string& name) 799 void mark_global (const std::string& name)
796 { 800 {
797 if (m_rep) 801 if (m_rep)
798 m_rep->mark_global (name); 802 m_rep->mark_global (name);
799 } 803 }