summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-23 23:44:49 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-11-24 07:35:50 -0800
commitee0832ceab256e5d1ed74d0767fa3bd420bc5bd6 (patch)
treedfc557ea25928b81db1177adf7a53d4f3f077131 /op.c
parent4ded55f35550b45910091ebeac7889f08d209fe4 (diff)
downloadperl-ee0832ceab256e5d1ed74d0767fa3bd420bc5bd6.tar.gz
Warn by default for constant my sub redefinition
I apparently never had this working and never tested it either. I was checking whether the new sub was a constant, rather than the one it was clobbering.
Diffstat (limited to 'op.c')
-rw-r--r--op.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index 0e287e1202..871982ca04 100644
--- a/op.c
+++ b/op.c
@@ -7056,7 +7056,7 @@ Perl_newMYSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
else {
/* redundant check that avoids creating the extra SV
most of the time: */
- if (const_sv || ckWARN(WARN_REDEFINE)) {
+ if (CvCONST(cv) || ckWARN(WARN_REDEFINE)) {
const line_t oldline = CopLINE(PL_curcop);
SV *noamp = sv_2mortal(newSVpvn_utf8(
PadnamePV(name)+1,PadnameLEN(name)-1,