summaryrefslogtreecommitdiff
path: root/universal.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-01-05 10:58:06 +0000
committerNicholas Clark <nick@ccl4.org>2010-01-05 10:58:06 +0000
commit1d021cc8647e49fd860b50abddff99a11b306e2e (patch)
tree4d2c2f0c3e70bcea6d2109f80efd1a2edd6d6ca0 /universal.c
parent0d8e5a4232d47607128a737a8561e2e273632386 (diff)
downloadperl-1d021cc8647e49fd860b50abddff99a11b306e2e.tar.gz
Tie::Hash::NamedCapture::* shouldn't abort if passed bad input [RT #71828]
Diffstat (limited to 'universal.c')
-rw-r--r--universal.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/universal.c b/universal.c
index 941587db63..3a91c5c61d 100644
--- a/universal.c
+++ b/universal.c
@@ -1368,7 +1368,7 @@ XS(XS_Tie_Hash_NamedCapture_FETCH)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
XSRETURN_UNDEF;
SP -= items;
@@ -1398,7 +1398,7 @@ XS(XS_Tie_Hash_NamedCapture_STORE)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx) {
+ if (!rx || !SvROK(ST(0))) {
if (!PL_localizing)
Perl_croak(aTHX_ "%s", PL_no_modify);
else
@@ -1421,7 +1421,7 @@ XS(XS_Tie_Hash_NamedCapture_DELETE)
if (items != 2)
croak_xs_usage(cv, "$key, $flags");
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
Perl_croak(aTHX_ "%s", PL_no_modify);
SP -= items;
@@ -1442,7 +1442,7 @@ XS(XS_Tie_Hash_NamedCapture_CLEAR)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
Perl_croak(aTHX_ "%s", PL_no_modify);
SP -= items;
@@ -1464,7 +1464,7 @@ XS(XS_Tie_Hash_NamedCapture_EXISTS)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
XSRETURN_UNDEF;
SP -= items;
@@ -1492,7 +1492,7 @@ XS(XS_Tie_Hash_NamedCapture_FIRSTK)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
XSRETURN_UNDEF;
SP -= items;
@@ -1524,7 +1524,7 @@ XS(XS_Tie_Hash_NamedCapture_NEXTK)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
XSRETURN_UNDEF;
SP -= items;
@@ -1555,7 +1555,7 @@ XS(XS_Tie_Hash_NamedCapture_SCALAR)
rx = PL_curpm ? PM_GETRE(PL_curpm) : NULL;
- if (!rx)
+ if (!rx || !SvROK(ST(0)))
XSRETURN_UNDEF;
SP -= items;