YAMASHINA Hio wrote:
> Hi.
> 
> A large amount of s///ge; consumes PL_tmps_stack in its loop.
> 
> This occues REPLACEMENT (right) part has statement ( eg. s//$x;$x/ge;).
> 
> Patch is follows:
> 
> diff -urN perl-5.8.7.orig/pp_ctl.c perl-5.8.7/pp_ctl.c
> --- perl-5.8.7.orig/pp_ctl.c    2005-04-22 23:12:38.000000000 +0900
> +++ perl-5.8.7/pp_ctl.c 2005-08-30 10:55:05.000000000 +0900
> @@ -188,6 +188,11 @@
>       if (!(cx->sb_rxtainted & 2) && SvTAINTED(TOPs))
>           cx->sb_rxtainted |= 2;
>       sv_catsv(dstr, POPs);
> +     if( (cx->sb_iters&0xFFFF)==0 ) {

OK, so if I understand correctly, you're doing that every 65536th loop ?
Just trying to understand your patch a bit more.

> +         /* shrink tmps stack */
> +         FREETMPS;
> +         SAVETMPS;
> +     }
> 
>       /* Are we done */
>       if (cx->sb_once || !CALLREGEXEC(aTHX_ rx, s, cx->sb_strend, orig,

Reply via email to