summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDave Mitchell <davem@fdisolutions.com>2007-06-18 00:00:30 +0000
committerDave Mitchell <davem@fdisolutions.com>2007-06-18 00:00:30 +0000
commit225593e1515f97126032fb4da0b1aafeb00e8e99 (patch)
treed67af8c6bcd5c4a94aa6908fc4415e995bdd7659 /regexec.c
parentb299c47c19f998a67478d8223c2faaac63ae623b (diff)
downloadperl-225593e1515f97126032fb4da0b1aafeb00e8e99.tar.gz
add test for, and update comments for, old defined($1) oddity.
Some code in regexec.c had a comment to the effect that without this code, Dynaloader failed (this is back at 5.6.0). Replace the comments with something more specific, and add a test for it (basically without the code $1 is '' rather than undefined sometimes). p4raw-id: //depot/perl@31408
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/regexec.c b/regexec.c
index a5f6bb5c94..b05a1770bf 100644
--- a/regexec.c
+++ b/regexec.c
@@ -285,9 +285,8 @@ S_regcppop(pTHX_ const regexp *rex)
* requiring null fields (pat.t#187 and split.t#{13,14}
* (as of patchlevel 7877) will fail. Then again,
* this code seems to be necessary or otherwise
- * building DynaLoader will fail:
- * "Error: '*' not in typemap in DynaLoader.xs, line 164"
- * --jhi */
+ * this erroneously leaves $1 defined: "1" =~ /^(?:(\d)x)?\d$/
+ * --jhi updated by dapm */
for (i = *PL_reglastparen + 1; i <= rex->nparens; i++) {
if (i > PL_regsize)
PL_regoffs[i].start = -1;
@@ -2267,13 +2266,12 @@ S_regtry(pTHX_ regmatch_info *reginfo, char **startpos)
/* Tests pat.t#187 and split.t#{13,14} seem to depend on this code.
* Actually, the code in regcppop() (which Ilya may be meaning by
* PL_reglastparen), is not needed at all by the test suite
- * (op/regexp, op/pat, op/split), but that code is needed, oddly
- * enough, for building DynaLoader, or otherwise this
- * "Error: '*' not in typemap in DynaLoader.xs, line 164"
- * will happen. Meanwhile, this code *is* needed for the
+ * (op/regexp, op/pat, op/split), but that code is needed otherwise
+ * this erroneously leaves $1 defined: "1" =~ /^(?:(\d)x)?\d$/
+ * Meanwhile, this code *is* needed for the
* above-mentioned test suite tests to succeed. The common theme
* on those tests seems to be returning null fields from matches.
- * --jhi */
+ * --jhi updated by dapm */
#if 1
if (prog->nparens) {
regexp_paren_pair *pp = PL_regoffs;