summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-04-09 19:25:37 +0100
committerDavid Mitchell <davem@iabyn.com>2009-04-20 01:53:46 +0100
commitb982e0442948a0bd0f96f1eb0b42ddd623ebc414 (patch)
tree7a3ad84bd9d511a5caa518ca6a864f1e9ab0ee74 /op.c
parentd0a6952466f8ee2ea42991c33461fb3ac3b63eac (diff)
downloadperl-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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/op.c b/op.c
index 39161376c2..246c8436b9 100644
--- a/op.c
+++ b/op.c
@@ -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);