Lundi le 03 janvier 2005, vers 04:39:48 (CET), Stephen J. Turnbull a
écrit:
>>>>> "Steinar" == Steinar Bang
<sb(a)dod.no> writes:
     Steinar> Could you suggest a workaround [for the XEmacs regexp
     Steinar> infloop] in Gnus?  A rewrite/restructuring of the regular
     Steinar> expressions, perhaps?
 No, not yet.  The fact that removing the code that actually implements
 shy groups short-circuits the infloop suggests a fencepost error in
 that code, but I don't see it.  
I think that I localized the bug.  If I understand correctly, the loop
that is around line 4805 of regex.c should be written:
    if (regs && regs->num_regs > 0)
      for (mcnt = num_nonshy_regs; mcnt < regs->num_regs; mcnt++)
        regs->start[mcnt] = regs->end[mcnt] = -1;
instead of:
    if (regs && regs->num_regs > 0)
      for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
        regs->start[mcnt] = regs->end[mcnt] = -1;
Note the "num_nonshy_regs" instead of "num_regs" in the for
construct.
With this fix, I cannot reproduce the bug anymore, and it makes also
valgrind happy (no errors).
I attached a patch against version 1.25.2.11 of regex.c.  The patch is
a bit long but it is mostly reformatting.
-- 
Arnaud