Fix index handling in ecma_op_advance_string_index (#3406)

Fixes #3389

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2019-12-04 11:14:25 +01:00
committed by Dániel Bátyai
parent bfc495f0cb
commit 4443c88bf4
+4 -1
View File
@@ -2816,7 +2816,10 @@ ecma_op_advance_string_index (ecma_string_t *str_p, /**< input string */
bool is_unicode) /**< true - if regexp object's "unicode" flag is set
false - otherwise */
{
JERRY_ASSERT (index < UINT32_MAX - 1);
if (index >= UINT32_MAX - 1)
{
return UINT32_MAX;
}
uint32_t next_index = index + 1;