Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [[ -v a[key] ]] syntax memory leak & undefined associative array keys detected as set



On Wed, Aug 08, 2018 at 09:31:05PM +0000, Anssi Palin wrote:
> My original message in this thread about problems introduced around Zsh 5.5.1 
> with the ${+a[$key]} syntax went somewhat unnoticed. Has the issue been 
> investigated since? I feel the problem is somewhat urgent as in the meantime 
> I've modified some of my scripts to use a workaround with dummy keys to get 
> them to execute similarly as before.

It doesn't work correctly for me on 5.5.1 either; I can confirm the
broken behavior:

	hobbes% zsh -f
	hobbes% setopt ksharrays
	hobbes% typeset -A a
	hobbes% ((${+a[key]})) && print should not echo
	should not echo
	hobbes%

Although interestingly enough:

	hobbes% zsh -f
	hobbes% setopt ksharrays
	hobbes% typeset -A a
	hobbes% [[ -v a[key] ]]
	hobbes% ((${+a[key]})) && print should not echo
	hobbes%

This is the with the zsh currently packaged on arch:

	bobbes% zsh --version
	zsh 5.5.1 (x86_64-unknown-linux-gnu)
	hobbes%

When I get home I'll try compiling the current HEAD to see if the
behavior has changed.

-- 
Cheers,
Joey Pabalinas

Attachment: signature.asc
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author