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

Re: unbounded recursive call in a shell script crashes zsh



2017-04-11 15:00 GMT+02:00 Kamil Dudka <kdudka@xxxxxxxxxx>:
> The following shell script crashes zsh (tested with zsh-5.3.1-90-g63f086d):
>
>     function foo() {
>         if true; then
>             foo
>         fi
>     }
>
>     foo

That's interesting:

$ zsh -c 'foo() { foo }; foo'
foo: maximum nested function level reached

$ zsh -c 'foo() { if true; then foo; fi }; foo'
Segmentation fault

-- 
Jérémie



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