Allocating an extra SV for rare edge cases...er...only needs to be
done in those rare edge cases.
Uninitialized warnings are only supposed to be enabled when they are.
svl = TOPm1s;
useleft = USE_LEFT(svl);
- if(useleft && svr == svl) {
+ if(useleft && svr == svl && SvGMAGICAL(svl)) {
/* Print the uninitialized warning now, so it includes the vari-
able name. */
- if (!SvOK(svl)) report_uninit(svl), useleft = 0;
+ if (!SvOK(svl)) {
+ if (ckWARN(WARN_UNINITIALIZED)) report_uninit(svl);
+ useleft = 0;
+ }
/* Non-magical sv_mortalcopy */
svl = sv_newmortal();
sv_setsv_flags(svl, svr, 0);
tie my $m1, "";
my $v = $m1 + $m1;
+no warnings;
+$v = $m1 + $m1;
EXPECT
Use of uninitialized value $m1 in addition (+) at - line 6.
Use of uninitialized value $m1 in addition (+) at - line 6.