summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-04-09 19:25:37 +0100
committerNicholas Clark <nick@ccl4.org>2009-04-09 19:25:37 +0100
commitee6d2783b2d78accfac54397826acf5f6e1715e1 (patch)
treee634f78b92c7e471938d549d9073c5a3078e251d /op.c
parent5a8cf367090fb5d83d8e8e0ae381a3525a215928 (diff)
downloadperl-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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/op.c b/op.c
index 517f6483ed..89ed5227da 100644
--- a/op.c
+++ b/op.c
@@ -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);