Add stack-overflow check for Array.prototype.{flat, flatMap} (#4899)

This patch fixes #4890

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
Robert Fancsik
2021-12-15 10:28:18 +01:00
committed by GitHub
parent 42523bd6e2
commit bcc711e731
3 changed files with 28 additions and 2 deletions
@@ -28,6 +28,7 @@
#include "ecma-objects.h"
#include "ecma-string-object.h"
#include "jcontext.h"
#include "jrt.h"
#include "lit-char-helpers.h"
@@ -2659,6 +2660,8 @@ ecma_builtin_array_flatten_into_array (ecma_value_t target, /**< target will con
ecma_value_t mapped_value, /**< mapped value */
ecma_value_t thisArg) /**< this arg */
{
ECMA_CHECK_STACK_USAGE ();
/* 7. */
ecma_length_t target_index = start;