Change 12614 by jhi@alpha on 2001/10/23 22:19:34
Negation and Unicode: sort of solves 20010303.010,
except not quite like reported in the Subject
(Perl_warner is still utf8-ignorant).
Affected files ...
... //depot/perl/pp.c#309 edit
... //depot/perl/t/lib/warnings/sv#3 edit
Differences ...
==== //depot/perl/pp.c#309 (text) ====
Index: perl/pp.c
--- perl/pp.c.~1~ Tue Oct 23 16:30:06 2001
+++ perl/pp.c Tue Oct 23 16:30:06 2001
@@ -2157,15 +2157,22 @@
sv_setsv(TARG, sv);
*SvPV_force(TARG, len) = *s == '-' ? '+' : '-';
}
- else if (DO_UTF8(sv) && UTF8_IS_START(*s) && isIDFIRST_utf8((U8*)s)) {
- sv_setpvn(TARG, "-", 1);
- sv_catsv(TARG, sv);
+ else if (DO_UTF8(sv)) {
+ SvIV_please(sv);
+ if (SvIOK(sv))
+ goto oops_its_an_int;
+ if (SvNOK(sv))
+ sv_setnv(TARG, -SvNV(sv));
+ else {
+ sv_setpvn(TARG, "-", 1);
+ sv_catsv(TARG, sv);
+ }
}
else {
- SvIV_please(sv);
- if (SvIOK(sv))
- goto oops_its_an_int;
- sv_setnv(TARG, -SvNV(sv));
+ SvIV_please(sv);
+ if (SvIOK(sv))
+ goto oops_its_an_int;
+ sv_setnv(TARG, -SvNV(sv));
}
SETTARG;
}
==== //depot/perl/t/lib/warnings/sv#3 (text) ====
Index: perl/t/lib/warnings/sv
--- perl/t/lib/warnings/sv.~1~ Tue Oct 23 16:30:06 2001
+++ perl/t/lib/warnings/sv Tue Oct 23 16:30:06 2001
@@ -326,3 +326,11 @@
$a = "\x{100}\x{200}" * 42;
EXPECT
Argument "\x{100}\x{200}" isn't numeric in multiplication (*) at - line 3.
+########
+# sv.c
+use warnings 'numeric' ;
+$a = "\x{100}\x{200}"; $a = -$a;
+no warnings 'numeric' ;
+$a = "\x{100}\x{200}"; $a = -$a;
+EXPECT
+Argument "\x{100}\x{200}" isn't numeric in negation (-) at - line 3.
End of Patch.