diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-04-09 19:25:37 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-04-09 19:25:37 +0100 |
commit | ee6d2783b2d78accfac54397826acf5f6e1715e1 (patch) | |
tree | e634f78b92c7e471938d549d9073c5a3078e251d /op.c | |
parent | 5a8cf367090fb5d83d8e8e0ae381a3525a215928 (diff) | |
download | perl-ee6d2783b2d78accfac54397826acf5f6e1715e1.tar.gz |
Don't SEGV while warning about redefining the format STDOUT. Fixes RT #64562.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -6166,9 +6166,13 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block) const line_t oldline = CopLINE(PL_curcop); if (PL_parser && PL_parser->copline != NOLINE) CopLINE_set(PL_curcop, PL_parser->copline); - Perl_warner(aTHX_ packWARN(WARN_REDEFINE), - o ? "Format %"SVf" redefined" - : "Format STDOUT redefined", SVfARG(cSVOPo->op_sv)); + if (o) { + Perl_warner(aTHX_ packWARN(WARN_REDEFINE), + "Format %"SVf" redefined", SVfARG(cSVOPo->op_sv)); + } else { + Perl_warner(aTHX_ packWARN(WARN_REDEFINE), + "Format STDOUT redefined"); + } CopLINE_set(PL_curcop, oldline); } SvREFCNT_dec(cv); |