zsh-workers
 help / color / mirror / code / Atom feed
* [[ -v a[key] ]] syntax memory leak & undefined associative array keys detected as set
@ 2018-05-18 21:59 Anssi Palin
  2018-05-19  8:49 ` Oliver Kiddle
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Anssi Palin @ 2018-05-18 21:59 UTC (permalink / raw)
  To: zsh-workers

Hello,

In workers/41719 I wrote about a memory leak with the (( ${+a[key]} )) syntax. 
While the issue has since been patched I've now noticed that the alternative 
[[ -v a[key] ]] syntax still suffers from the same problem in 5.5.1.

It also seems that post-patch Zsh is incorrectly detecting undefined keys as 
set in empty associative arrays when KSH_ARRAYS is in effect:

$ set -o KSH_ARRAYS
$ typeset -A a
$ if (( ${+a[undefined]} )); then echo 'Should not echo'; fi
Should not echo

Once the array is populated both set and undefined keys are detected correctly. 
The [[ -v a[key] ]] syntax does not appear to be affected in any case 
regardless of KSH_ARRAYS.

Thank you in advance.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-08-09  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-18 21:59 [[ -v a[key] ]] syntax memory leak & undefined associative array keys detected as set Anssi Palin
2018-05-19  8:49 ` Oliver Kiddle
2018-08-08 21:31 ` Anssi Palin
2018-08-08 22:44   ` Joey Pabalinas
2018-08-09  8:30   ` Peter Stephenson
2018-08-09  9:46 ` Sebastian Gniazdowski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).