summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perl.c5
-rw-r--r--perl.h2
-rw-r--r--regexec.c6
3 files changed, 6 insertions, 7 deletions
diff --git a/perl.c b/perl.c
index 13df3e453d..ebf5ca121d 100644
--- a/perl.c
+++ b/perl.c
@@ -258,6 +258,11 @@ perl_construct(pTHXx)
PL_fdpid = newAV(); /* for remembering popen pids by fd */
PL_modglobal = newHV(); /* pointers to per-interpreter module globals */
PL_errors = newSVpvn("",0);
+#ifdef DEBUGGING
+ sv_setpvn(PERL_DEBUG_PAD(0), "", 0); /* For regex debugging. */
+ sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
+ sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
+#endif
#ifdef USE_ITHREADS
PL_regex_padav = newAV();
av_push(PL_regex_padav,(SV*)newAV()); /* First entry is an array of empty elements */
diff --git a/perl.h b/perl.h
index f7bf179930..02e3f9c60e 100644
--- a/perl.h
+++ b/perl.h
@@ -3183,7 +3183,7 @@ struct perl_debug_pad {
};
#define PERL_DEBUG_PAD(i) &(PL_debug_pad.pad[i])
-#define PERL_DEBUG_PAD_ZERO(i) (sv_setpvn(PERL_DEBUG_PAD(i), "", 0), PERL_DEBUG_PAD(i))
+#define PERL_DEBUG_PAD_ZERO(i) (SvPVX(PERL_DEBUG_PAD(i))[0] = 0, SvCUR(PERL_DEBUG_PAD(i)) = 0, PERL_DEBUG_PAD(i))
/* Enable variables which are pointers to functions */
typedef void (CPERLscope(*peep_t))(pTHX_ OP* o);
diff --git a/regexec.c b/regexec.c
index 9264b8639a..00bd6ef793 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2054,12 +2054,6 @@ S_regtry(pTHX_ regexp *prog, char *startpos)
New(22,PL_reg_start_tmp, PL_reg_start_tmpl, char*);
}
-#ifdef DEBUGGING
- sv_setpvn(PERL_DEBUG_PAD(0), "", 0);
- sv_setpvn(PERL_DEBUG_PAD(1), "", 0);
- sv_setpvn(PERL_DEBUG_PAD(2), "", 0);
-#endif
-
/* XXXX What this code is doing here?!!! There should be no need
to do this again and again, PL_reglastparen should take care of
this! --ilya*/