summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-10-08 13:02:46 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-08 13:05:10 -0700
commit218fa151b7edc486a27eb8ece21cda2538edf177 (patch)
treef141c15d64cc2d4199dcf3602585b7c318a65d02 /op.c
parentb377a702c8dabfa8c074b816f6695cade1ba3a1b (diff)
downloadperl-218fa151b7edc486a27eb8ece21cda2538edf177.tar.gz
Dont’t crash when warning about XSUB redefinition
If the stash in question has no name, the attempt to generate the warning will cause a crash. Simply skipping the warning is this case is fine, as this is will into ‘undefined’ territory (but it still shouldn’t crash).
Diffstat (limited to 'op.c')
-rw-r--r--op.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/op.c b/op.c
index f9a12626d6..939b47869d 100644
--- a/op.c
+++ b/op.c
@@ -6937,14 +6937,14 @@ Perl_newXS_flags(pTHX_ const char *name, XSUBADDR_t subaddr,
}
else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) {
/* already defined (or promised) */
- /* XXX It's possible for this HvNAME_get to return null, and get passed into strEQ */
if (ckWARN(WARN_REDEFINE)) {
GV * const gvcv = CvGV(cv);
if (gvcv) {
HV * const stash = GvSTASH(gvcv);
if (stash) {
const char *redefined_name = HvNAME_get(stash);
- if ( strEQ(redefined_name,"autouse") ) {
+ if ( redefined_name &&
+ strEQ(redefined_name,"autouse") ) {
const line_t oldline = CopLINE(PL_curcop);
if (PL_parser && PL_parser->copline != NOLINE)
CopLINE_set(PL_curcop, PL_parser->copline);