Mercurial > octave
changeset 25205:22522ea137b4
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 11 Apr 2018 00:27:42 -0400 |
parents | 6afed459d063 (current diff) 72ea868ca63a (diff) |
children | 2815f3257c9a |
files | test/module.mk |
diffstat | 4 files changed, 28 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/symrec.h Tue Apr 10 23:33:53 2018 -0400 +++ b/libinterp/corefcn/symrec.h Wed Apr 11 00:27:42 2018 -0400 @@ -528,7 +528,7 @@ m_fwd_rep.reset (); } else - t_fwd_rep->unbind_fwd_rep (); + t_fwd_rep->unbind_global_rep (); } } @@ -686,6 +686,8 @@ m_rep->bind_fwd_rep (fwd_scope, sr.m_rep); } + void unbind_global_rep (void) { m_rep->unbind_global_rep (); } + void unbind_fwd_rep (void) { m_rep->unbind_fwd_rep (); } octave_value dump (context_id context) const
--- a/libinterp/corefcn/symscope.h Tue Apr 10 23:33:53 2018 -0400 +++ b/libinterp/corefcn/symscope.h Wed Apr 11 00:27:42 2018 -0400 @@ -277,7 +277,9 @@ { symbol_record& sr = nm_sr.second; - if (! (sr.is_persistent () || sr.is_forwarded ())) + if (sr.is_global ()) + sr.unbind_global_rep (); + else if (! (sr.is_persistent () || sr.is_forwarded ())) sr.clear (m_context); } }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/bug-53579.tst Wed Apr 11 00:27:42 2018 -0400 @@ -0,0 +1,21 @@ +%!function [raa, rbb, igaa, igbb] = sub1 (aa, bb) +%! global aa bb +%! aa = 1; +%! raa = aa; +%! rbb = bb; +%! igaa = isglobal ("aa"); +%! igbb = isglobal ("bb"); +%!endfunction + +%!test <*53579> +%! global aa bb +%! assert (isglobal ("aa")); +%! assert (isglobal ("bb")); +%! aa = 3; +%! xx = 5; +%! [raa, rbb, igaa, igbb] = sub1 (aa, xx); +%! assert (raa, 1); +%! assert (rbb, []); +%! assert (igaa); +%! assert (igbb); +%! assert (xx, 5);