comparison libinterp/corefcn/stack-frame.cc @ 29854:2bb72743d3eb

who() should not display duplicate named variables from different scopes (bug #60845). * stack-frame.cc (make_symbol_info_list): Add test to check if frame_offset() is greater than 0 (we're in a nested function) and don't display additional variables from those frames.
author John W. Eaton <jwe@octave.org>
date Mon, 05 Jul 2021 08:46:16 -0700
parents 32f4357ac8d9
children 3e419a830e90
comparison
equal deleted inserted replaced
29853:b918ef934b71 29854:2bb72743d3eb
1096 1096
1097 for (const auto& sym : symrec_list) 1097 for (const auto& sym : symrec_list)
1098 { 1098 {
1099 octave_value value = varval (sym); 1099 octave_value value = varval (sym);
1100 1100
1101 if (value.is_defined ()) 1101 if (! value.is_defined ()
1102 { 1102 || (is_user_fcn_frame () && sym.frame_offset () > 0))
1103 symbol_info syminf (sym.name (), value, sym.is_formal (), 1103 continue;
1104 is_global (sym), is_persistent (sym)); 1104
1105 1105 symbol_info syminf (sym.name (), value, sym.is_formal (),
1106 symbol_stats.append (syminf); 1106 is_global (sym), is_persistent (sym));
1107 } 1107
1108 symbol_stats.append (syminf);
1108 } 1109 }
1109 1110
1110 return symbol_stats; 1111 return symbol_stats;
1111 } 1112 }
1112 1113