(b) give -1, rather than +1
p4raw-id: //depot/perl@24998
return;
}
if (!(flags & SVp_POK)) {
- if ((flags & SVTYPEMASK) < SVt_PVNV)
- sv_upgrade(sv, SVt_NV);
- SvNV_set(sv, 1.0);
- (void)SvNOK_only(sv);
+ if ((flags & SVTYPEMASK) < SVt_PVIV)
+ sv_upgrade(sv, ((flags & SVTYPEMASK) > SVt_IV) ? SVt_PVIV : SVt_IV);
+ SvIV_set(sv, -1);
+ (void)SvIOK_only(sv);
return;
}
#ifdef PERL_PRESERVE_IVUV
# use strict;
-print "1..26\n";
+print "1..30\n";
my $test = 1;
}
check_same (\%orig, \%postdec);
+
+{
+ no warnings 'uninitialized';
+ my $x, $y;
+ eval {
+ $y ="$x\n";
+ ++$x;
+ };
+ ok($x == 1, $x);
+ ok($@ eq '', $@);
+
+ my $p, $q;
+ eval {
+ $q ="$p\n";
+ --$p;
+ };
+ ok($p == -1, $p);
+ ok($@ eq '', $@);
+}