summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-01-09 12:46:01 -0800
committerFather Chrysostomos <sprout@cpan.org>2012-01-09 13:24:03 -0800
commit6b349a5c4c70a7c99eeaabacafc3ea993f2c7869 (patch)
tree6c873f46bdfbba9d2584bed44c217114ae36b54b /doop.c
parent10cca365fcca0349c1d46c3a7ac05f425585739f (diff)
downloadperl-6b349a5c4c70a7c99eeaabacafc3ea993f2c7869.tar.gz
[perl #44895] += warning on uninit magic var
The only uses of USE_LEFT in core now occur when SvGETMAGIC has already been called. So returning true for magical SVs is not neces- sary. In fact, it was never correct. Also, the code in do_vop (which handles bitwise operations on strings) to avoid an uninitialized warning had the same buggy SvGMAGICAL check. Now, the warning from $uninit += 1 is suppressed for all undefined vars, not just amagical ones. This causes 6 to-do tests in assignwarn.t to pass.
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/doop.c b/doop.c
index 231b3d86e0..f1304772c2 100644
--- a/doop.c
+++ b/doop.c
@@ -1014,7 +1014,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
PERL_ARGS_ASSERT_DO_VOP;
- if (sv != left || (optype != OP_BIT_AND && !SvOK(sv) && !SvGMAGICAL(sv)))
+ if (sv != left || (optype != OP_BIT_AND && !SvOK(sv)))
sv_setpvs(sv, ""); /* avoid undef warning on |= and ^= */
if (sv == left) {
lsave = lc = SvPV_force_nomg(left, leftlen);