From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12667 invoked from network); 18 Jun 2006 12:38:34 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FORGED_RCVD_HELO autolearn=ham version=3.1.3 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 18 Jun 2006 12:38:34 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 27188 invoked from network); 18 Jun 2006 12:38:26 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 18 Jun 2006 12:38:26 -0000 Received: (qmail 13638 invoked by alias); 18 Jun 2006 12:38:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 22499 Received: (qmail 13628 invoked from network); 18 Jun 2006 12:38:22 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 18 Jun 2006 12:38:22 -0000 Received: (qmail 26900 invoked from network); 18 Jun 2006 12:38:22 -0000 Received: from mta07-winn.ispmail.ntl.com (HELO mtaout01-winn.ispmail.ntl.com) (81.103.221.47) by a.mx.sunsite.dk with SMTP; 18 Jun 2006 12:38:21 -0000 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com with ESMTP id <20060618123820.EISA13446.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com> for ; Sun, 18 Jun 2006 13:38:20 +0100 Received: from pwslaptop.csr.com ([81.107.41.155]) by aamtaout01-winn.ispmail.ntl.com with ESMTP id <20060618123820.DREI19763.aamtaout01-winn.ispmail.ntl.com@pwslaptop.csr.com> for ; Sun, 18 Jun 2006 13:38:20 +0100 Received: from pwslaptop.csr.com (pwslaptop.csr.com [127.0.0.1]) by pwslaptop.csr.com (8.13.6/8.13.4) with ESMTP id k5ICcCXY007519; Sun, 18 Jun 2006 13:38:12 +0100 Message-Id: <200606181238.k5ICcCXY007519@pwslaptop.csr.com> From: Peter Stephenson To: zsh-workers@sunsite.dk, pws@pwslaptop.csr.com Subject: Re: Recursion error and line numbers In-Reply-To: Message from Bart Schaefer of "Sat, 17 Jun 2006 10:46:23 PDT." <060617104623.ZM336@torch.brasslantern.com> Date: Sun, 18 Jun 2006 13:38:12 +0100 Bart Schaefer wrote: > local foo=(); local bar > > In workers/22495 I wrote: > > > zsh% local > > local:10: maximum nested function level reached > > zsh% On the two PCs I tried this on (neither particularly antiquated) it crashed, so the maximum function depth of 4096 isn't limited enough. How about 1000? That seems to stop it. > There are not 10 lines in the function "local", nor are there 50 lines > when I try the "compinit" test and mysteriously get the error twice: > > zsh% compinit > local:50: maximum nested function level reached > local:1: maximum nested function level reached > zsh% > > Obviously the recursion depth isn't 1 or 10 or 50 either. Where is that > number coming from? I would have expected "1" in all cases. It's a subtle effect of line number handling and I haven't quite worked out why yet. It seems that in the case in question we haven't quite got around to setting the line number in the function yet (on any of the 4096 calls). Compare with: % local() { :; local bar; } % local local: maximum nested function level reached No line number (0 is suppressed). % local() { :; local bar; } % local local:1: maximum nested function level reached The 1 you're expecting. This is obviously a bug but I haven't it traced it. -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/