| 53 |
system files. */ |
system files. */ |
| 54 |
|
|
| 55 |
#define SLJIT_CONFIG_AUTO 1 |
#define SLJIT_CONFIG_AUTO 1 |
| 56 |
|
#define SLJIT_CONFIG_STATIC 1 |
| 57 |
#define SLJIT_VERBOSE 0 |
#define SLJIT_VERBOSE 0 |
| 58 |
#define SLJIT_DEBUG 0 |
#define SLJIT_DEBUG 0 |
| 59 |
|
|
| 277 |
int bsr_nltype; |
int bsr_nltype; |
| 278 |
int endonly; |
int endonly; |
| 279 |
sljit_w ctypes; |
sljit_w ctypes; |
| 280 |
|
sljit_uw name_table; |
| 281 |
|
sljit_w name_count; |
| 282 |
|
sljit_w name_entry_size; |
| 283 |
struct sljit_label *acceptlabel; |
struct sljit_label *acceptlabel; |
| 284 |
stub_list *stubs; |
stub_list *stubs; |
| 285 |
recurse_entry *entries; |
recurse_entry *entries; |
| 555 |
case OP_REF: |
case OP_REF: |
| 556 |
case OP_REFI: |
case OP_REFI: |
| 557 |
case OP_CREF: |
case OP_CREF: |
| 558 |
|
case OP_NCREF: |
| 559 |
|
case OP_RREF: |
| 560 |
|
case OP_NRREF: |
| 561 |
case OP_CLOSE: |
case OP_CLOSE: |
| 562 |
cc += 3; |
cc += 3; |
| 563 |
return cc; |
return cc; |
| 1986 |
struct sljit_jump *jump; |
struct sljit_jump *jump; |
| 1987 |
#endif |
#endif |
| 1988 |
|
|
| 1989 |
SLJIT_ASSERT(ctype_word == 0x10); |
SLJIT_COMPILE_ASSERT(ctype_word == 0x10, ctype_word_must_be_16); |
| 1990 |
|
|
| 1991 |
sljit_emit_fast_enter(compiler, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, 1, 5, 5, common->localsize); |
sljit_emit_fast_enter(compiler, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, 1, 5, 5, common->localsize); |
| 1992 |
/* Get type of the previous char, and put it to LOCALS1. */ |
/* Get type of the previous char, and put it to LOCALS1. */ |
| 3801 |
return cc + 1 + LINK_SIZE; |
return cc + 1 + LINK_SIZE; |
| 3802 |
} |
} |
| 3803 |
|
|
| 3804 |
|
static sljit_w SLJIT_CALL do_searchovector(sljit_w refno, sljit_w* locals, uschar *name_table) |
| 3805 |
|
{ |
| 3806 |
|
int condition = FALSE; |
| 3807 |
|
uschar *slotA = name_table; |
| 3808 |
|
uschar *slotB; |
| 3809 |
|
sljit_w name_count = locals[LOCALS0 / sizeof(sljit_w)]; |
| 3810 |
|
sljit_w name_entry_size = locals[LOCALS1 / sizeof(sljit_w)]; |
| 3811 |
|
sljit_w no_capture; |
| 3812 |
|
int i; |
| 3813 |
|
|
| 3814 |
|
locals += OVECTOR_START / sizeof(sljit_w); |
| 3815 |
|
no_capture = locals[1]; |
| 3816 |
|
|
| 3817 |
|
for (i = 0; i < name_count; i++) |
| 3818 |
|
{ |
| 3819 |
|
if (GET2(slotA, 0) == refno) break; |
| 3820 |
|
slotA += name_entry_size; |
| 3821 |
|
} |
| 3822 |
|
|
| 3823 |
|
if (i < name_count) |
| 3824 |
|
{ |
| 3825 |
|
/* Found a name for the number - there can be only one; duplicate names |
| 3826 |
|
for different numbers are allowed, but not vice versa. First scan down |
| 3827 |
|
for duplicates. */ |
| 3828 |
|
|
| 3829 |
|
slotB = slotA; |
| 3830 |
|
while (slotB > name_table) |
| 3831 |
|
{ |
| 3832 |
|
slotB -= name_entry_size; |
| 3833 |
|
if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) |
| 3834 |
|
{ |
| 3835 |
|
condition = locals[GET2(slotB, 0) << 1] != no_capture; |
| 3836 |
|
if (condition) break; |
| 3837 |
|
} |
| 3838 |
|
else break; |
| 3839 |
|
} |
| 3840 |
|
|
| 3841 |
|
/* Scan up for duplicates */ |
| 3842 |
|
if (!condition) |
| 3843 |
|
{ |
| 3844 |
|
slotB = slotA; |
| 3845 |
|
for (i++; i < name_count; i++) |
| 3846 |
|
{ |
| 3847 |
|
slotB += name_entry_size; |
| 3848 |
|
if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) |
| 3849 |
|
{ |
| 3850 |
|
condition = locals[GET2(slotB, 0) << 1] != no_capture; |
| 3851 |
|
if (condition) break; |
| 3852 |
|
} |
| 3853 |
|
else break; |
| 3854 |
|
} |
| 3855 |
|
} |
| 3856 |
|
} |
| 3857 |
|
return condition; |
| 3858 |
|
} |
| 3859 |
|
|
| 3860 |
|
static sljit_w SLJIT_CALL do_searchgroups(sljit_w recno, sljit_w* locals, uschar *name_table) |
| 3861 |
|
{ |
| 3862 |
|
int condition = FALSE; |
| 3863 |
|
uschar *slotA = name_table; |
| 3864 |
|
uschar *slotB; |
| 3865 |
|
sljit_w name_count = locals[LOCALS0 / sizeof(sljit_w)]; |
| 3866 |
|
sljit_w name_entry_size = locals[LOCALS1 / sizeof(sljit_w)]; |
| 3867 |
|
sljit_w group_num = locals[POSSESSIVE0 / sizeof(sljit_w)]; |
| 3868 |
|
int i; |
| 3869 |
|
|
| 3870 |
|
for (i = 0; i < name_count; i++) |
| 3871 |
|
{ |
| 3872 |
|
if (GET2(slotA, 0) == recno) break; |
| 3873 |
|
slotA += name_entry_size; |
| 3874 |
|
} |
| 3875 |
|
|
| 3876 |
|
if (i < name_count) |
| 3877 |
|
{ |
| 3878 |
|
/* Found a name for the number - there can be only one; duplicate |
| 3879 |
|
names for different numbers are allowed, but not vice versa. First |
| 3880 |
|
scan down for duplicates. */ |
| 3881 |
|
|
| 3882 |
|
slotB = slotA; |
| 3883 |
|
while (slotB > name_table) |
| 3884 |
|
{ |
| 3885 |
|
slotB -= name_entry_size; |
| 3886 |
|
if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) |
| 3887 |
|
{ |
| 3888 |
|
condition = GET2(slotB, 0) == group_num; |
| 3889 |
|
if (condition) break; |
| 3890 |
|
} |
| 3891 |
|
else break; |
| 3892 |
|
} |
| 3893 |
|
|
| 3894 |
|
/* Scan up for duplicates */ |
| 3895 |
|
if (!condition) |
| 3896 |
|
{ |
| 3897 |
|
slotB = slotA; |
| 3898 |
|
for (i++; i < name_count; i++) |
| 3899 |
|
{ |
| 3900 |
|
slotB += name_entry_size; |
| 3901 |
|
if (strcmp((char *)slotA + 2, (char *)slotB + 2) == 0) |
| 3902 |
|
{ |
| 3903 |
|
condition = GET2(slotB, 0) == group_num; |
| 3904 |
|
if (condition) break; |
| 3905 |
|
} |
| 3906 |
|
else break; |
| 3907 |
|
} |
| 3908 |
|
} |
| 3909 |
|
} |
| 3910 |
|
return condition; |
| 3911 |
|
} |
| 3912 |
|
|
| 3913 |
/* |
/* |
| 3914 |
Handling bracketed expressions is probably the most complex part. |
Handling bracketed expressions is probably the most complex part. |
| 3915 |
|
|
| 3994 |
|
|
| 3995 |
opcode = *cc; |
opcode = *cc; |
| 3996 |
ccbegin = cc; |
ccbegin = cc; |
| 3997 |
|
hotpath = ccbegin + 1 + LINK_SIZE; |
| 3998 |
|
|
| 3999 |
if ((opcode == OP_COND || opcode == OP_SCOND) && cc[1 + LINK_SIZE] == OP_DEF) |
if ((opcode == OP_COND || opcode == OP_SCOND) && cc[1 + LINK_SIZE] == OP_DEF) |
| 4000 |
{ |
{ |
| 4001 |
/* Drop this bracket_fallback. */ |
/* Drop this bracket_fallback. */ |
| 4007 |
SLJIT_ASSERT(ket == OP_KET || ket == OP_KETRMAX || ket == OP_KETRMIN); |
SLJIT_ASSERT(ket == OP_KET || ket == OP_KETRMAX || ket == OP_KETRMIN); |
| 4008 |
SLJIT_ASSERT(!((bra == OP_BRAZERO && ket == OP_KETRMIN) || (bra == OP_BRAMINZERO && ket == OP_KETRMAX))); |
SLJIT_ASSERT(!((bra == OP_BRAZERO && ket == OP_KETRMIN) || (bra == OP_BRAMINZERO && ket == OP_KETRMAX))); |
| 4009 |
cc += GET(cc, 1); |
cc += GET(cc, 1); |
| 4010 |
has_alternatives = *cc == OP_ALT || opcode == OP_COND || opcode == OP_SCOND; |
|
| 4011 |
|
has_alternatives = *cc == OP_ALT; |
| 4012 |
|
if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) |
| 4013 |
|
{ |
| 4014 |
|
has_alternatives = (*hotpath == OP_RREF) ? FALSE : TRUE; |
| 4015 |
|
if (*hotpath == OP_NRREF) |
| 4016 |
|
{ |
| 4017 |
|
stacksize = GET2(hotpath, 1); |
| 4018 |
|
if (common->currententry == NULL || stacksize == RREF_ANY) |
| 4019 |
|
has_alternatives = FALSE; |
| 4020 |
|
else if (common->currententry->start == 0) |
| 4021 |
|
has_alternatives = stacksize != 0; |
| 4022 |
|
else |
| 4023 |
|
has_alternatives = stacksize != GET2(common->start, common->currententry->start + 1 + LINK_SIZE); |
| 4024 |
|
} |
| 4025 |
|
} |
| 4026 |
|
|
| 4027 |
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) |
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) |
| 4028 |
opcode = OP_SCOND; |
opcode = OP_SCOND; |
| 4029 |
if (SLJIT_UNLIKELY(opcode == OP_ONCE_NC)) |
if (SLJIT_UNLIKELY(opcode == OP_ONCE_NC)) |
| 4036 |
localptr = OVECTOR_PRIV(offset); |
localptr = OVECTOR_PRIV(offset); |
| 4037 |
offset <<= 1; |
offset <<= 1; |
| 4038 |
FALLBACK_AS(bracket_fallback)->localptr = localptr; |
FALLBACK_AS(bracket_fallback)->localptr = localptr; |
| 4039 |
|
hotpath += 2; |
| 4040 |
} |
} |
| 4041 |
else if (opcode == OP_ONCE || opcode == OP_SBRA || opcode == OP_SCOND) |
else if (opcode == OP_ONCE || opcode == OP_SBRA || opcode == OP_SCOND) |
| 4042 |
{ |
{ |
| 4193 |
} |
} |
| 4194 |
|
|
| 4195 |
/* Generating code for the first alternative. */ |
/* Generating code for the first alternative. */ |
|
hotpath = ccbegin + 1 + LINK_SIZE; |
|
|
if (offset != 0) |
|
|
hotpath += 2; |
|
| 4196 |
if (opcode == OP_COND || opcode == OP_SCOND) |
if (opcode == OP_COND || opcode == OP_SCOND) |
| 4197 |
{ |
{ |
| 4198 |
if (*hotpath == OP_CREF) |
if (*hotpath == OP_CREF) |
| 4199 |
{ |
{ |
| 4200 |
|
SLJIT_ASSERT(has_alternatives); |
| 4201 |
add_jump(compiler, &(FALLBACK_AS(bracket_fallback)->u.condfailed), |
add_jump(compiler, &(FALLBACK_AS(bracket_fallback)->u.condfailed), |
| 4202 |
CMP(SLJIT_C_EQUAL, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR((GET2(hotpath, 1) << 1)), SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(1))); |
CMP(SLJIT_C_EQUAL, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(GET2(hotpath, 1) << 1), SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(1))); |
| 4203 |
hotpath += 3; |
hotpath += 3; |
| 4204 |
} |
} |
| 4205 |
|
else if (*hotpath == OP_NCREF) |
| 4206 |
|
{ |
| 4207 |
|
SLJIT_ASSERT(has_alternatives); |
| 4208 |
|
stacksize = GET2(hotpath, 1); |
| 4209 |
|
jump = CMP(SLJIT_C_NOT_EQUAL, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(stacksize << 1), SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(1)); |
| 4210 |
|
|
| 4211 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE1, STACK_TOP, 0); |
| 4212 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, SLJIT_IMM, common->name_count); |
| 4213 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS1, SLJIT_IMM, common->name_entry_size); |
| 4214 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG1, 0, SLJIT_IMM, stacksize); |
| 4215 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG2, 0, SLJIT_LOCALS_REG, 0); |
| 4216 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG3, 0, SLJIT_IMM, common->name_table); |
| 4217 |
|
sljit_emit_ijump(compiler, SLJIT_CALL3, SLJIT_IMM, SLJIT_FUNC_OFFSET(do_searchovector)); |
| 4218 |
|
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE1); |
| 4219 |
|
add_jump(compiler, &(FALLBACK_AS(bracket_fallback)->u.condfailed), CMP(SLJIT_C_EQUAL, SLJIT_TEMPORARY_REG1, 0, SLJIT_IMM, 0)); |
| 4220 |
|
|
| 4221 |
|
JUMPHERE(jump); |
| 4222 |
|
hotpath += 3; |
| 4223 |
|
} |
| 4224 |
|
else if (*hotpath == OP_RREF || *hotpath == OP_NRREF) |
| 4225 |
|
{ |
| 4226 |
|
/* Never has other case. */ |
| 4227 |
|
FALLBACK_AS(bracket_fallback)->u.condfailed = NULL; |
| 4228 |
|
|
| 4229 |
|
stacksize = GET2(hotpath, 1); |
| 4230 |
|
if (common->currententry == NULL) |
| 4231 |
|
stacksize = 0; |
| 4232 |
|
else if (stacksize == RREF_ANY) |
| 4233 |
|
stacksize = 1; |
| 4234 |
|
else if (common->currententry->start == 0) |
| 4235 |
|
stacksize = stacksize == 0; |
| 4236 |
|
else |
| 4237 |
|
stacksize = stacksize == GET2(common->start, common->currententry->start + 1 + LINK_SIZE); |
| 4238 |
|
|
| 4239 |
|
if (*hotpath == OP_RREF || stacksize || common->currententry == NULL) |
| 4240 |
|
{ |
| 4241 |
|
SLJIT_ASSERT(!has_alternatives); |
| 4242 |
|
if (stacksize != 0) |
| 4243 |
|
hotpath += 3; |
| 4244 |
|
else |
| 4245 |
|
{ |
| 4246 |
|
if (*cc == OP_ALT) |
| 4247 |
|
{ |
| 4248 |
|
hotpath = cc + 1 + LINK_SIZE; |
| 4249 |
|
cc += GET(cc, 1); |
| 4250 |
|
} |
| 4251 |
|
else |
| 4252 |
|
hotpath = cc; |
| 4253 |
|
} |
| 4254 |
|
} |
| 4255 |
|
else |
| 4256 |
|
{ |
| 4257 |
|
SLJIT_ASSERT(has_alternatives); |
| 4258 |
|
|
| 4259 |
|
stacksize = GET2(hotpath, 1); |
| 4260 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE1, STACK_TOP, 0); |
| 4261 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, SLJIT_IMM, common->name_count); |
| 4262 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS1, SLJIT_IMM, common->name_entry_size); |
| 4263 |
|
OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0, SLJIT_IMM, GET2(common->start, common->currententry->start + 1 + LINK_SIZE)); |
| 4264 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG1, 0, SLJIT_IMM, stacksize); |
| 4265 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG2, 0, SLJIT_LOCALS_REG, 0); |
| 4266 |
|
OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG3, 0, SLJIT_IMM, common->name_table); |
| 4267 |
|
sljit_emit_ijump(compiler, SLJIT_CALL3, SLJIT_IMM, SLJIT_FUNC_OFFSET(do_searchgroups)); |
| 4268 |
|
OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE1); |
| 4269 |
|
add_jump(compiler, &(FALLBACK_AS(bracket_fallback)->u.condfailed), CMP(SLJIT_C_EQUAL, SLJIT_TEMPORARY_REG1, 0, SLJIT_IMM, 0)); |
| 4270 |
|
hotpath += 3; |
| 4271 |
|
} |
| 4272 |
|
} |
| 4273 |
else |
else |
| 4274 |
{ |
{ |
| 4275 |
SLJIT_ASSERT(*hotpath >= OP_ASSERT && *hotpath <= OP_ASSERTBACK_NOT); |
SLJIT_ASSERT(has_alternatives && *hotpath >= OP_ASSERT && *hotpath <= OP_ASSERTBACK_NOT); |
| 4276 |
/* Similar code as PUSH_FALLBACK macro. */ |
/* Similar code as PUSH_FALLBACK macro. */ |
| 4277 |
assert = sljit_alloc_memory(compiler, sizeof(assert_fallback)); |
assert = sljit_alloc_memory(compiler, sizeof(assert_fallback)); |
| 4278 |
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) |
if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler))) |
| 5432 |
uschar bra = OP_BRA; |
uschar bra = OP_BRA; |
| 5433 |
uschar ket; |
uschar ket; |
| 5434 |
assert_fallback *assert; |
assert_fallback *assert; |
| 5435 |
|
BOOL has_alternatives; |
| 5436 |
struct sljit_jump *brazero = NULL; |
struct sljit_jump *brazero = NULL; |
| 5437 |
struct sljit_jump *once = NULL; |
struct sljit_jump *once = NULL; |
| 5438 |
struct sljit_jump *cond = NULL; |
struct sljit_jump *cond = NULL; |
| 5448 |
ccbegin = cc; |
ccbegin = cc; |
| 5449 |
ket = *(bracketend(ccbegin) - 1 - LINK_SIZE); |
ket = *(bracketend(ccbegin) - 1 - LINK_SIZE); |
| 5450 |
cc += GET(cc, 1); |
cc += GET(cc, 1); |
| 5451 |
|
has_alternatives = *cc == OP_ALT; |
| 5452 |
|
if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) |
| 5453 |
|
has_alternatives = (ccbegin[1 + LINK_SIZE] >= OP_ASSERT && ccbegin[1 + LINK_SIZE] <= OP_ASSERTBACK_NOT) || CURRENT_AS(bracket_fallback)->u.condfailed != NULL; |
| 5454 |
if (opcode == OP_CBRA || opcode == OP_SCBRA) |
if (opcode == OP_CBRA || opcode == OP_SCBRA) |
| 5455 |
offset = (GET2(ccbegin, 1 + LINK_SIZE)) << 1; |
offset = (GET2(ccbegin, 1 + LINK_SIZE)) << 1; |
| 5456 |
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) |
if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) |
| 5499 |
brazero = CMP(SLJIT_C_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0); |
brazero = CMP(SLJIT_C_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0); |
| 5500 |
} |
} |
| 5501 |
|
|
| 5502 |
if (opcode == OP_ONCE) |
if (SLJIT_UNLIKELY(opcode == OP_ONCE)) |
| 5503 |
{ |
{ |
| 5504 |
if (CURRENT_AS(bracket_fallback)->u.framesize >= 0) |
if (CURRENT_AS(bracket_fallback)->u.framesize >= 0) |
| 5505 |
{ |
{ |
| 5508 |
} |
} |
| 5509 |
once = JUMP(SLJIT_JUMP); |
once = JUMP(SLJIT_JUMP); |
| 5510 |
} |
} |
| 5511 |
|
else if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) |
| 5512 |
|
{ |
| 5513 |
|
if (has_alternatives) |
| 5514 |
|
{ |
| 5515 |
|
/* Always exactly one alternative. */ |
| 5516 |
|
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); |
| 5517 |
|
free_stack(common, 1); |
| 5518 |
|
|
| 5519 |
|
jumplistitem = sljit_alloc_memory(compiler, sizeof(jump_list)); |
| 5520 |
|
if (SLJIT_UNLIKELY(!jumplistitem)) |
| 5521 |
|
return; |
| 5522 |
|
jumplist = jumplistitem; |
| 5523 |
|
jumplistitem->next = NULL; |
| 5524 |
|
jumplistitem->jump = CMP(SLJIT_C_EQUAL, TMP1, 0, SLJIT_IMM, 1); |
| 5525 |
|
} |
| 5526 |
|
} |
| 5527 |
else if (*cc == OP_ALT) |
else if (*cc == OP_ALT) |
| 5528 |
{ |
{ |
| 5529 |
/* Build a jump list. Get the last successfully matched branch index. */ |
/* Build a jump list. Get the last successfully matched branch index. */ |
| 5555 |
|
|
| 5556 |
cc = ccbegin + GET(ccbegin, 1); |
cc = ccbegin + GET(ccbegin, 1); |
| 5557 |
} |
} |
|
else if (opcode == OP_COND || opcode == OP_SCOND) |
|
|
{ |
|
|
/* Always one. */ |
|
|
OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(STACK_TOP), STACK(0)); |
|
|
free_stack(common, 1); |
|
|
|
|
|
jumplistitem = sljit_alloc_memory(compiler, sizeof(jump_list)); |
|
|
if (SLJIT_UNLIKELY(!jumplistitem)) |
|
|
return; |
|
|
jumplist = jumplistitem; |
|
|
jumplistitem->next = NULL; |
|
|
jumplistitem->jump = CMP(SLJIT_C_EQUAL, TMP1, 0, SLJIT_IMM, 1); |
|
|
} |
|
| 5558 |
|
|
| 5559 |
COMPILE_FALLBACKPATH(current->top); |
COMPILE_FALLBACKPATH(current->top); |
| 5560 |
if (current->topfallbacks) |
if (current->topfallbacks) |
| 5561 |
set_jumps(current->topfallbacks, LABEL()); |
set_jumps(current->topfallbacks, LABEL()); |
| 5562 |
|
|
| 5563 |
if (opcode == OP_COND || opcode == OP_SCOND) |
if (SLJIT_UNLIKELY(opcode == OP_COND) || SLJIT_UNLIKELY(opcode == OP_SCOND)) |
| 5564 |
{ |
{ |
| 5565 |
/* Conditional block always has at most one alternative. */ |
/* Conditional block always has at most one alternative. */ |
| 5566 |
if (ccbegin[1 + LINK_SIZE] >= OP_ASSERT && ccbegin[1 + LINK_SIZE] <= OP_ASSERTBACK_NOT) |
if (ccbegin[1 + LINK_SIZE] >= OP_ASSERT && ccbegin[1 + LINK_SIZE] <= OP_ASSERTBACK_NOT) |
| 5567 |
{ |
{ |
| 5568 |
|
SLJIT_ASSERT(has_alternatives); |
| 5569 |
assert = CURRENT_AS(bracket_fallback)->u.assert; |
assert = CURRENT_AS(bracket_fallback)->u.assert; |
| 5570 |
if (assert->framesize >= 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK)) |
if (assert->framesize >= 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK)) |
| 5571 |
{ |
{ |
| 5576 |
cond = JUMP(SLJIT_JUMP); |
cond = JUMP(SLJIT_JUMP); |
| 5577 |
set_jumps(CURRENT_AS(bracket_fallback)->u.assert->condfailed, LABEL()); |
set_jumps(CURRENT_AS(bracket_fallback)->u.assert->condfailed, LABEL()); |
| 5578 |
} |
} |
| 5579 |
else |
else if (CURRENT_AS(bracket_fallback)->u.condfailed != NULL) |
| 5580 |
{ |
{ |
| 5581 |
|
SLJIT_ASSERT(has_alternatives); |
| 5582 |
cond = JUMP(SLJIT_JUMP); |
cond = JUMP(SLJIT_JUMP); |
| 5583 |
set_jumps(CURRENT_AS(bracket_fallback)->u.condfailed, LABEL()); |
set_jumps(CURRENT_AS(bracket_fallback)->u.condfailed, LABEL()); |
| 5584 |
} |
} |
| 5585 |
|
else |
| 5586 |
|
SLJIT_ASSERT(!has_alternatives); |
| 5587 |
} |
} |
| 5588 |
|
|
| 5589 |
if (*cc == OP_ALT || opcode == OP_COND || opcode == OP_SCOND) |
if (has_alternatives) |
| 5590 |
{ |
{ |
| 5591 |
count = 1; |
count = 1; |
| 5592 |
do |
do |
| 6092 |
fallback_common rootfallback; |
fallback_common rootfallback; |
| 6093 |
compiler_common common_data; |
compiler_common common_data; |
| 6094 |
compiler_common *common = &common_data; |
compiler_common *common = &common_data; |
| 6095 |
const unsigned char *tables = re->tables; |
const uschar *tables = re->tables; |
| 6096 |
pcre_study_data *study; |
pcre_study_data *study; |
| 6097 |
uschar *ccend; |
uschar *ccend; |
| 6098 |
executable_function *function; |
executable_function *function; |
| 6153 |
} |
} |
| 6154 |
common->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; |
common->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; |
| 6155 |
common->ctypes = (sljit_w)(tables + ctypes_offset); |
common->ctypes = (sljit_w)(tables + ctypes_offset); |
| 6156 |
|
common->name_table = (sljit_w)re + re->name_table_offset; |
| 6157 |
|
common->name_count = re->name_count; |
| 6158 |
|
common->name_entry_size = re->name_entry_size; |
| 6159 |
common->acceptlabel = NULL; |
common->acceptlabel = NULL; |
| 6160 |
common->stubs = NULL; |
common->stubs = NULL; |
| 6161 |
common->entries = NULL; |
common->entries = NULL; |