diff --git a/jerry-core/ecma/base/ecma-helpers-string.c b/jerry-core/ecma/base/ecma-helpers-string.c index 4317d462a..5f83ab278 100644 --- a/jerry-core/ecma/base/ecma-helpers-string.c +++ b/jerry-core/ecma/base/ecma-helpers-string.c @@ -561,7 +561,7 @@ ecma_new_ecma_string_from_length (ecma_length_t number) /**< property length */ } #if ENABLED (JERRY_ESNEXT) - JERRY_ASSERT (number <= ECMA_NUMBER_MAX_SAFE_INTEGER); + JERRY_ASSERT ((ecma_number_t) number <= ECMA_NUMBER_MAX_SAFE_INTEGER); if (JERRY_UNLIKELY (number > UINT32_MAX)) { @@ -2968,7 +2968,7 @@ 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 <= ECMA_NUMBER_MAX_SAFE_INTEGER); + JERRY_ASSERT ((ecma_number_t) index <= ECMA_NUMBER_MAX_SAFE_INTEGER); ecma_length_t next_index = index + 1; if (!is_unicode) diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c index bab92aa1f..773e29c80 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-array-prototype.c @@ -474,7 +474,7 @@ ecma_builtin_array_prototype_object_push (const ecma_value_t *argument_list_p, / #if ENABLED (JERRY_ESNEXT) /* 5. */ - if (length + arguments_number > ECMA_NUMBER_MAX_SAFE_INTEGER) + if ((ecma_number_t) (length + arguments_number) > ECMA_NUMBER_MAX_SAFE_INTEGER) { return ecma_raise_type_error (ECMA_ERR_MSG ("Pushing element over 2**53-1 length is disallowed")); } @@ -1563,7 +1563,7 @@ ecma_builtin_array_prototype_object_unshift (const ecma_value_t args[], /**< arg { #if ENABLED (JERRY_ESNEXT) /* ES11:4.a. */ - if (len + args_number > ECMA_NUMBER_MAX_SAFE_INTEGER) + if ((ecma_number_t) (len + args_number) > ECMA_NUMBER_MAX_SAFE_INTEGER) { return ecma_raise_type_error (ECMA_ERR_MSG ("Unshift elements over 2**53-1 length is disallowed")); } @@ -1661,7 +1661,7 @@ ecma_builtin_array_prototype_object_index_of (const ecma_value_t args[], /**< ar } /* 6. */ - if (idx >= len) + if (idx >= (ecma_number_t) len) { return ecma_make_number_value (-1); } diff --git a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c index bc0537faf..041e78707 100644 --- a/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c +++ b/jerry-core/ecma/builtin-objects/ecma-builtin-helpers.c @@ -367,7 +367,7 @@ ecma_builtin_helper_array_concat_value (ecma_object_t *array_obj_p, /**< array * } /* 4 . */ - if (*length_p + arg_len > ECMA_NUMBER_MAX_SAFE_INTEGER) + if ((ecma_number_t) (*length_p + arg_len) > ECMA_NUMBER_MAX_SAFE_INTEGER) { return ecma_raise_type_error (ECMA_ERR_MSG ("Invalid array length.")); }