Mercurial > octave
comparison libinterp/corefcn/symscope.h @ 25203:72ea868ca63a stable
allow function parameters to be global (bug #53579)
* symrec.h (symbol_record::unbind_global_rep): New function.
* symscope.h (symbol_scope::refresh): Use it to also unbind global
symbols.
* test/bug-53579.tst: New file.
* test/module.mk: Update.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 11 Apr 2018 00:07:06 -0400 |
parents | c80323fe4938 |
children | 3ff9192b676e |
comparison
equal
deleted
inserted
replaced
25202:d12271fe1504 | 25203:72ea868ca63a |
---|---|
275 { | 275 { |
276 for (auto& nm_sr : m_symbols) | 276 for (auto& nm_sr : m_symbols) |
277 { | 277 { |
278 symbol_record& sr = nm_sr.second; | 278 symbol_record& sr = nm_sr.second; |
279 | 279 |
280 if (! (sr.is_persistent () || sr.is_forwarded ())) | 280 if (sr.is_global ()) |
281 sr.unbind_global_rep (); | |
282 else if (! (sr.is_persistent () || sr.is_forwarded ())) | |
281 sr.clear (m_context); | 283 sr.clear (m_context); |
282 } | 284 } |
283 } | 285 } |
284 | 286 |
285 void clear_variables (void) | 287 void clear_variables (void) |