Fix a few issues which can lead to undefined-behaviour (#1730)

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
This commit is contained in:
Zsolt Borbély
2017-04-13 14:34:10 +02:00
committed by yichoi
parent 605e9847d2
commit 950a0f10cd
3 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -2754,7 +2754,8 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
frame_ctx.is_eval_code = is_eval_code;
frame_ctx.call_operation = VM_NO_EXEC_OP;
ecma_value_t stack[call_stack_size];
/* Use JERRY_MAX() to avoid array declaration with size 0. */
ecma_value_t stack[JERRY_MAX (call_stack_size, 1)];
frame_ctx.registers_p = stack;
return vm_execute (&frame_ctx, arg_list_p, arg_list_len);