summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-01-01 21:58:50 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-01-01 21:58:50 +0000
commita12c0f5690a38b5b84d767b0f8b7cc133a68affc (patch)
tree957c36e29d66b811d962b168a32ea4675a1a846a /pp_hot.c
parentc8991b40a4a3c9ec8efc70a2420a12ff1ce50eb0 (diff)
downloadperl-a12c0f5690a38b5b84d767b0f8b7cc133a68affc.tar.gz
More rigor in UTF-8-ness of Encode's toUnicode
XS export some of the utf8 internal functions. Test some of the functions. Fix pp_concat() bug shown by said tests. p4raw-id: //depot/perlio@8293
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pp_hot.c b/pp_hot.c
index f9c5960a63..795ba32fc9 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -155,6 +155,10 @@ PP(pp_concat)
left_utf8 = DO_UTF8(left);
right_utf8 = DO_UTF8(right);
+ if (!left_utf8 && !right_utf8 && SvUTF8(TARG)) {
+ SvUTF8_off(TARG);
+ }
+
if (left_utf8 != right_utf8 && !IN_BYTE) {
if (TARG == right && !right_utf8) {
sv_utf8_upgrade(TARG); /* Now straight binary copy */
@@ -289,7 +293,7 @@ PP(pp_eq)
if (SvIOK(TOPm1s)) {
bool auvok = SvUOK(TOPm1s);
bool buvok = SvUOK(TOPs);
-
+
if (!auvok && !buvok) { /* ## IV == IV ## */
IV aiv = SvIVX(TOPm1s);
IV biv = SvIVX(TOPs);
@@ -416,7 +420,7 @@ PP(pp_add)
if (SvIOK(TOPm1s)) {
bool auvok = SvUOK(TOPm1s);
bool buvok = SvUOK(TOPs);
-
+
if (!auvok && !buvok) { /* ## IV + IV ## */
IV aiv = SvIVX(TOPm1s);
IV biv = SvIVX(TOPs);
@@ -459,7 +463,7 @@ PP(pp_add)
aiv = SvIVX(TOPs);
buv = SvUVX(TOPm1s);
}
-
+
if (aiv >= 0) {
UV result = (UV)aiv + buv;
if (result >= buv) {
@@ -1627,7 +1631,7 @@ PP(pp_helem)
STRLEN keylen;
char *key = SvPV(keysv, keylen);
save_delete(hv, key, keylen);
- } else
+ } else
save_helem(hv, keysv, svp);
}
}
@@ -1857,7 +1861,7 @@ PP(pp_subst)
if (PL_tainted)
rxtainted |= 2;
TAINT_NOT;
-
+
force_it:
if (!pm || !s)
DIE(aTHX_ "panic: pp_subst");