From: Ilya Zakharevich Date: Fri, 27 Nov 1998 16:16:48 +0000 (-0500) Subject: better -Mre=debugcolor X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=364723c2ea2c2681016fad994c4f40cc3a0bb17d;p=p5sagit%2Fp5-mst-13.2.git better -Mre=debugcolor Message-Id: <199811272116.QAA03502@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@2371 --- diff --git a/embedvar.h b/embedvar.h index b1aad3a..9d82427 100644 --- a/embedvar.h +++ b/embedvar.h @@ -61,6 +61,7 @@ #define PL_reg_re (PL_curinterp->Treg_re) #define PL_reg_start_tmp (PL_curinterp->Treg_start_tmp) #define PL_reg_start_tmpl (PL_curinterp->Treg_start_tmpl) +#define PL_reg_starttry (PL_curinterp->Treg_starttry) #define PL_reg_sv (PL_curinterp->Treg_sv) #define PL_regbol (PL_curinterp->Tregbol) #define PL_regcc (PL_curinterp->Tregcc) @@ -449,6 +450,7 @@ #define PL_Treg_re PL_reg_re #define PL_Treg_start_tmp PL_reg_start_tmp #define PL_Treg_start_tmpl PL_reg_start_tmpl +#define PL_Treg_starttry PL_reg_starttry #define PL_Treg_sv PL_reg_sv #define PL_Tregbol PL_regbol #define PL_Tregcc PL_regcc @@ -580,6 +582,7 @@ #define PL_reg_re (thr->Treg_re) #define PL_reg_start_tmp (thr->Treg_start_tmp) #define PL_reg_start_tmpl (thr->Treg_start_tmpl) +#define PL_reg_starttry (thr->Treg_starttry) #define PL_reg_sv (thr->Treg_sv) #define PL_regbol (thr->Tregbol) #define PL_regcc (thr->Tregcc) diff --git a/objXSUB.h b/objXSUB.h index 2a86440..3c154e4 100644 --- a/objXSUB.h +++ b/objXSUB.h @@ -510,6 +510,8 @@ #define PL_reg_start_tmp pPerl->PL_reg_start_tmp #undef PL_reg_start_tmpl #define PL_reg_start_tmpl pPerl->PL_reg_start_tmpl +#undef PL_reg_starttry +#define PL_reg_starttry pPerl->PL_reg_starttry #undef PL_reg_sv #define PL_reg_sv pPerl->PL_reg_sv #undef PL_regbol diff --git a/regexec.c b/regexec.c index e4de1ed..36a35b0 100644 --- a/regexec.c +++ b/regexec.c @@ -1080,6 +1080,7 @@ regtry(regexp *prog, char *startpos) PL_reglastparen = &prog->lastparen; prog->lastparen = 0; PL_regsize = 0; + DEBUG_r(PL_reg_starttry = startpos); if (PL_reg_start_tmpl <= prog->nparens) { PL_reg_start_tmpl = prog->nparens*3/2 + 3; if(PL_reg_start_tmp) @@ -1161,7 +1162,7 @@ regmatch(regnode *prog) int l = (PL_regeol - locinput > taill ? taill : PL_regeol - locinput); int pref_len = (locinput - PL_bostr > (5 + taill) - l ? (5 + taill) - l : locinput - PL_bostr); - int pref0_len = pref_len - (locinput - PL_reginput); + int pref0_len = pref_len - (locinput - PL_reg_starttry); if (l + pref_len < (5 + taill) && l < PL_regeol - locinput) l = ( PL_regeol - locinput > (5 + taill) - pref_len diff --git a/thrdvar.h b/thrdvar.h index 7c72259..d9cb9c6 100644 --- a/thrdvar.h +++ b/thrdvar.h @@ -167,6 +167,7 @@ PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags)) /* Pointer to RE executer */ PERLVARI(Treginterp_cnt,int, 0) /* Whether `re' was interpolated. */ +PERLVARI(Treg_starttry, char *, 0) /* -Dr: where regtry was called. */ #ifdef DEBUGGING PERLVARI(Twatchaddr, char **, 0) PERLVAR(Twatchok, char *)