On 5/7/14, 10:21 AM, Dan Douglas wrote: > Another one to do with namerefs. :-) > > Looks like it's when the target of the ref is local to the same scope. > > $ gdb -q -ex 'run -c "function f { typeset x; typeset -n x; x=y; }; f"' ./bash
Thanks for the report. This is an abstraction layer violation (and a long- lived one; it's been this way for years). I've attached a patch for people to play with. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3-patched/variables.c 2014-02-14 11:55:12.000000000 -0500 --- variables.c 2014-05-07 10:53:57.000000000 -0400 *************** *** 2198,2205 **** old_var = find_variable (name); if (old_var && local_p (old_var) && old_var->context == variable_context) ! { ! VUNSETATTR (old_var, att_invisible); /* XXX */ ! return (old_var); ! } was_tmpvar = old_var && tempvar_p (old_var); --- 2260,2264 ---- old_var = find_variable (name); if (old_var && local_p (old_var) && old_var->context == variable_context) ! return (old_var); was_tmpvar = old_var && tempvar_p (old_var);