xfree(op->exact.s);
break;
+ case OP_CCLASS_NOT: case OP_CCLASS:
+ xfree(op->cclass.bsp);
+ break;
+
case OP_CCLASS_MB_NOT: case OP_CCLASS_MB:
xfree(op->cclass_mb.mb);
break;
case OP_CCLASS_MIX_NOT: case OP_CCLASS_MIX:
xfree(op->cclass_mix.mb);
+ xfree(op->cclass_mix.bsp);
break;
case OP_BACKREF1: case OP_BACKREF2: case OP_BACKREF_N: case OP_BACKREF_N_IC:
r = add_op(reg, IS_NCCLASS_NOT(cc) ? OP_CCLASS_NOT : OP_CCLASS);
if (r != 0) return r;
- xmemcpy(COP(reg)->cclass.bs, cc->bs, SIZE_BITSET);
+ COP(reg)->cclass.bsp = xmalloc(SIZE_BITSET);
+ CHECK_NULL_RETURN_MEMERR(COP(reg)->cclass.bsp);
+ xmemcpy(COP(reg)->cclass.bsp, cc->bs, SIZE_BITSET);
}
else {
void* p;
r = add_op(reg, IS_NCCLASS_NOT(cc) ? OP_CCLASS_MIX_NOT : OP_CCLASS_MIX);
if (r != 0) return r;
- xmemcpy(COP(reg)->cclass_mix.bs, cc->bs, SIZE_BITSET);
+ COP(reg)->cclass_mix.bsp = xmalloc(SIZE_BITSET);
+ CHECK_NULL_RETURN_MEMERR(COP(reg)->cclass_mix.bsp);
+ xmemcpy(COP(reg)->cclass_mix.bsp, cc->bs, SIZE_BITSET);
p = set_multi_byte_cclass(cc->mbuf, reg);
CHECK_NULL_RETURN_MEMERR(p);
CASE_OP(CCLASS)
DATA_ENSURE(1);
- if (BITSET_AT(p->cclass.bs, *s) == 0) goto fail;
+ if (BITSET_AT(p->cclass.bsp, *s) == 0) goto fail;
s += enclen(encode, s); /* OP_CCLASS can match mb-code. \D, \S */
INC_OP;
NEXT_OUT;
goto cclass_mb;
}
else {
- if (BITSET_AT(p->cclass_mix.bs, *s) == 0)
+ if (BITSET_AT(p->cclass_mix.bsp, *s) == 0)
goto fail;
s++;
CASE_OP(CCLASS_NOT)
DATA_ENSURE(1);
- if (BITSET_AT(p->cclass.bs, *s) != 0) goto fail;
+ if (BITSET_AT(p->cclass.bsp, *s) != 0) goto fail;
s += enclen(encode, s);
INC_OP;
NEXT_OUT;
goto cclass_mb_not;
}
else {
- if (BITSET_AT(p->cclass_mix.bs, *s) != 0)
+ if (BITSET_AT(p->cclass_mix.bsp, *s) != 0)
goto fail;
s++;