if (comp > 0xff) {
if (!complement) {
- Copy(s, d, len, U8);
+ Move(s, d, len, U8);
d += len;
}
else {
continue;
}
else if (ch == -1) { /* -1 is unmapped character */
- Copy(s, d, len, U8);
+ Move(s, d, len, U8);
d += len;
}
else if (ch == -2) /* -2 is delete character */
matches++;
}
else if (ch == -1) { /* -1 is unmapped character */
- Copy(s, d, len, U8);
+ Move(s, d, len, U8);
d += len;
}
else if (ch == -2) /* -2 is delete character */
const bool left_utf = DO_UTF8(left);
const bool right_utf = DO_UTF8(right);
I32 needlen = 0;
- bool needfree = FALSE;
if (left_utf && !right_utf)
sv_utf8_upgrade(right);
if ((left_utf || right_utf) && (sv == left || sv == right)) {
needlen = optype == OP_BIT_AND ? len : leftlen + rightlen;
Newxz(dc, needlen + 1, char);
- needfree = TRUE;
}
else if (SvOK(sv) || SvTYPE(sv) > SVt_PVMG) {
dc = SvPV_force_nomg_nolen(sv);
duc = luc & ruc;
dc = (char*)uvchr_to_utf8((U8*)dc, duc);
}
- if (sv == left || sv == right) {
- (void)sv_usepvn(sv, dcorig, needlen); /* Uses Renew(). */
- needfree = FALSE; /* sv_usepvn() moved dcorig. */
- }
+ if (sv == left || sv == right)
+ (void)sv_usepvn(sv, dcorig, needlen);
SvCUR_set(sv, dc - dcorig);
break;
case OP_BIT_XOR:
duc = luc | ruc;
dc = (char*)uvchr_to_utf8((U8*)dc, duc);
}
- goto mop_up_utf; /* For consistency. */
mop_up_utf:
if (rulen)
dcsave = savepvn(rc, rulen);
else if (lulen)
dcsave = savepvn(lc, lulen);
- if (sv == left || sv == right) {
+ if (sv == left || sv == right)
(void)sv_usepvn(sv, dcorig, needlen); /* Uses Renew(). */
- needfree = FALSE; /* sv_usepvn() moved dcorig. */
- }
SvCUR_set(sv, dc - dcorig);
if (rulen)
sv_catpvn(sv, dcsave, rulen);
*SvEND(sv) = '\0';
Safefree(dcsave);
break;
+ default:
+ if (sv == left || sv == right)
+ Safefree(dcorig);
+ Perl_croak(aTHX_ "panic: do_vop called for op %u (%s)", optype,
+ PL_op_name[optype]);
}
- if (needfree)
- Safefree(dcorig);
SvUTF8_on(sv);
goto finish;
}