Op 29-12-19 om 19:20 schreef Fernando Muñoz:
When compiling mksh with ASAN and running [[ -v $XX ]] ($XX being an undefined environment variable) mksh will crash.
Of course it shouldn't crash, but it's worth noting that the correct form is [[ -v XX ]] without the dollar sign (signifying the expansion of the variable, not the variable itself).
With the expansion of a nonexistent variable, you're effectively testing [[ -v '' ]] which I would guess is probably what triggers the crash.
- M. -- modernish -- harness the shell https://github.com/modernish/modernish