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

Re: "Overlarge EPROG nref" with functions -c



> On 22 September 2021 at 15:26 Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Wed, Sep 22, 2021 at 12:03 AM Mikael Magnusson <mikachu@xxxxxxxxx> 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);




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