zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: "Overlarge EPROG nref" with functions -c
Date: Wed, 22 Sep 2021 16:01:51 +0100 (BST)	[thread overview]
Message-ID: <1639875338.19327.1632322911208@mail2.virginmedia.com> (raw)
In-Reply-To: <CAH+w=7ZvbUqFzzVCDY6Wi0qzyX-BcxzWxbGnkTrtehZmXj5zmQ@mail.gmail.com>

> On 22 September 2021 at 15:26 Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Wed, Sep 22, 2021 at 12:03 AM Mikael Magnusson <mikachu@gmail.com> wrote:
> >
> >  parse.c:2816: Overlarge EPROG nref
> 
> This means that the number of references to the function exceeds
> MAX_FUNCTION_DEPTH.  I presume it checks this because most of the time
> these references come from recursive calls to the function.

Yes, agreed.

The path of least resistance is probably just to remove this debug warning,
which has no further effect and which I don't think we've ever seen in anger.
"functions -c" is supposed to be transparently using the existing reference
mechanism, so adding code for this specific case looks to me more likely to
introduce bugs than help track down bugs we've never seen down.

Unless anyone has smart suggestions...

pws

diff --git a/Src/parse.c b/Src/parse.c
index 10d193ba1..d612b7e17 100644
--- a/Src/parse.c
+++ b/Src/parse.c
@@ -2811,10 +2811,6 @@ freeeprog(Eprog p)
        DPUTS(p->nref > 0 && (p->flags & EF_HEAP), "Heap EPROG has nref > 0");
        DPUTS(p->nref < 0 && !(p->flags & EF_HEAP), "Real EPROG has nref < 0");
        DPUTS(p->nref < -1, "Uninitialised EPROG nref");
-#ifdef MAX_FUNCTION_DEPTH
-       DPUTS(zsh_funcnest >=0 && p->nref > zsh_funcnest + 10,
-             "Overlarge EPROG nref");
-#endif
        if (p->nref > 0 && !--p->nref) {
            for (i = p->npats, pp = p->pats; i--; pp++)
                freepatprog(*pp);


      reply	other threads:[~2021-09-22 15:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22  7:02 Mikael Magnusson
2021-09-22 14:26 ` Bart Schaefer
2021-09-22 15:01   ` Peter Stephenson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1639875338.19327.1632322911208@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    --subject='Re: "Overlarge EPROG nref" with functions -c' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this 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).