diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-04-09 19:25:37 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2009-04-20 01:53:46 +0100 |
commit | b982e0442948a0bd0f96f1eb0b42ddd623ebc414 (patch) | |
tree | 7a3ad84bd9d511a5caa518ca6a864f1e9ab0ee74 /op.c | |
parent | d0a6952466f8ee2ea42991c33461fb3ac3b63eac (diff) | |
download | perl-b982e0442948a0bd0f96f1eb0b42ddd623ebc414.tar.gz |
Don't SEGV while warning about redefining the format STDOUT. Fixes RT #64562.
(cherry picked from commit ee6d2783b2d78accfac54397826acf5f6e1715e1)
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -6116,9 +6116,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); |