Remove executor steps/match limit from RegExp.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
This commit is contained in:
committed by
Dániel Bátyai
parent
9ab0f23e48
commit
7a3636b5ce
@@ -297,13 +297,6 @@ re_match_regexp (re_matcher_ctx_t *re_ctx_p, /**< RegExp matcher context */
|
|||||||
|
|
||||||
while ((op = re_get_opcode (&bc_p)))
|
while ((op = re_get_opcode (&bc_p)))
|
||||||
{
|
{
|
||||||
if (re_ctx_p->match_limit >= RE_EXECUTE_MATCH_LIMIT)
|
|
||||||
{
|
|
||||||
ret_value = ecma_raise_range_error ("RegExp executor steps limit is exceeded.");
|
|
||||||
return ret_value;
|
|
||||||
}
|
|
||||||
re_ctx_p->match_limit++;
|
|
||||||
|
|
||||||
switch (op)
|
switch (op)
|
||||||
{
|
{
|
||||||
case RE_OP_MATCH:
|
case RE_OP_MATCH:
|
||||||
@@ -1245,7 +1238,6 @@ ecma_regexp_exec_helper (ecma_value_t regexp_value, /**< RegExp object */
|
|||||||
re_matcher_ctx_t re_ctx;
|
re_matcher_ctx_t re_ctx;
|
||||||
re_ctx.input_start_p = iterator.buf_p;
|
re_ctx.input_start_p = iterator.buf_p;
|
||||||
re_ctx.input_end_p = iterator.buf_p + iterator.buf_size;
|
re_ctx.input_end_p = iterator.buf_p + iterator.buf_size;
|
||||||
re_ctx.match_limit = 0;
|
|
||||||
re_ctx.recursion_depth = 0;
|
re_ctx.recursion_depth = 0;
|
||||||
|
|
||||||
/* 1. Read bytecode header and init regexp matcher context. */
|
/* 1. Read bytecode header and init regexp matcher context. */
|
||||||
|
|||||||
@@ -34,11 +34,6 @@
|
|||||||
*/
|
*/
|
||||||
#define RE_EXECUTE_RECURSION_LIMIT 1000
|
#define RE_EXECUTE_RECURSION_LIMIT 1000
|
||||||
|
|
||||||
/**
|
|
||||||
* Limit of RegExp execetur matching steps
|
|
||||||
*/
|
|
||||||
#define RE_EXECUTE_MATCH_LIMIT 10000
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RegExp flags
|
* RegExp flags
|
||||||
*/
|
*/
|
||||||
@@ -54,7 +49,6 @@ typedef struct
|
|||||||
lit_utf8_iterator_t *saved_p; /**< saved result string pointers, ECMA 262 v5, 15.10.2.1, State */
|
lit_utf8_iterator_t *saved_p; /**< saved result string pointers, ECMA 262 v5, 15.10.2.1, State */
|
||||||
const lit_utf8_byte_t *input_start_p; /**< start of input pattern string */
|
const lit_utf8_byte_t *input_start_p; /**< start of input pattern string */
|
||||||
const lit_utf8_byte_t *input_end_p; /**< end of input pattern string */
|
const lit_utf8_byte_t *input_end_p; /**< end of input pattern string */
|
||||||
uint32_t match_limit; /**< matching limit counter */
|
|
||||||
uint32_t recursion_depth; /**< recursion depth counter */
|
uint32_t recursion_depth; /**< recursion depth counter */
|
||||||
uint32_t num_of_captures; /**< number of capture groups */
|
uint32_t num_of_captures; /**< number of capture groups */
|
||||||
uint32_t num_of_non_captures; /**< number of non-capture groups */
|
uint32_t num_of_non_captures; /**< number of non-capture groups */
|
||||||
|
|||||||
Reference in New Issue
Block a user