diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-10-08 13:02:46 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-08 13:05:10 -0700 |
commit | 218fa151b7edc486a27eb8ece21cda2538edf177 (patch) | |
tree | f141c15d64cc2d4199dcf3602585b7c318a65d02 /op.c | |
parent | b377a702c8dabfa8c074b816f6695cade1ba3a1b (diff) | |
download | perl-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |