Skip to content

Commit 5907aa6

Browse files
author
Fabrice Bellard
committed
added missing lre_poll_timeout()
1 parent 47aac8b commit 5907aa6

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

‎libregexp.c‎

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2764,6 +2764,8 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
27642764
if (type != RE_EXEC_STATE_LOOKAHEAD)
27652765
break;
27662766
}
2767+
if (lre_poll_timeout(s))
2768+
return LRE_RET_TIMEOUT;
27672769
break;
27682770
case REOP_lookahead_match:
27692771
/* pop all the saved states until reaching the start of
@@ -2866,19 +2868,6 @@ static intptr_t lre_exec_backtrack(REExecContext *s, uint8_t **capture,
28662868
case REOP_negative_lookahead:
28672869
val = get_u32(pc);
28682870
pc += 4;
2869-
if (opcode == REOP_lookahead && bp != s->stack_buf && 0) {
2870-
int i;
2871-
/* save all the capture state so that they can be
2872-
restored in case of failure after the lookahead
2873-
matches */
2874-
idx = 4 * s->capture_count;
2875-
CHECK_STACK_SPACE(idx);
2876-
for(i = 0; i < 2 * s->capture_count; i++) {
2877-
sp[0].val = i;
2878-
sp[1].ptr = capture[i];
2879-
sp += 2;
2880-
}
2881-
}
28822871
CHECK_STACK_SPACE(3);
28832872
sp[0].ptr = (uint8_t *)(pc + (int)val);
28842873
sp[1].ptr = (uint8_t *)cptr;

0 commit comments

Comments
 (0)