Use C99's variable length array instead of alloca
JerryScript-DCO-1.0-Signed-off-by: Yanhui Shen shen.elf@gmail.com
This commit is contained in:
+1
-5
@@ -36,8 +36,6 @@
|
|||||||
#include "vm.h"
|
#include "vm.h"
|
||||||
#include "vm-stack.h"
|
#include "vm-stack.h"
|
||||||
|
|
||||||
#include <alloca.h>
|
|
||||||
|
|
||||||
/** \addtogroup vm Virtual machine
|
/** \addtogroup vm Virtual machine
|
||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
@@ -2635,9 +2633,7 @@ vm_run_with_alloca (vm_frame_ctx_t *frame_ctx_p, /**< frame context */
|
|||||||
ecma_length_t arg_list_len, /**< length of arguments list */
|
ecma_length_t arg_list_len, /**< length of arguments list */
|
||||||
uint32_t call_stack_size) /**< call stack size */
|
uint32_t call_stack_size) /**< call stack size */
|
||||||
{
|
{
|
||||||
size_t size = call_stack_size * sizeof (ecma_value_t);
|
ecma_value_t stack[call_stack_size];
|
||||||
|
|
||||||
ecma_value_t *stack = (ecma_value_t *) alloca (size);
|
|
||||||
|
|
||||||
frame_ctx_p->registers_p = stack;
|
frame_ctx_p->registers_p = stack;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user