Skip to content

Commit 4e227d1

Browse files
committed
fix bug in vm call_stack_size calculation
call_stack_size should be register_count + maximum stack depth JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang [email protected]
1 parent baeb83d commit 4e227d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jerry-core/vm/vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2677,7 +2677,7 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
26772677
literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint16_arguments_t));
26782678
frame_ctx.literal_start_p = literal_p;
26792679
literal_p += args_p->literal_end;
2680-
call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
2680+
call_stack_size = (uint32_t) args_p->stack_limit;
26812681
}
26822682
else
26832683
{
@@ -2687,7 +2687,7 @@ vm_run (const ecma_compiled_code_t *bytecode_header_p, /**< byte-code data heade
26872687
literal_p = (jmem_cpointer_t *) (byte_p + sizeof (cbc_uint8_arguments_t));
26882688
frame_ctx.literal_start_p = literal_p;
26892689
literal_p += args_p->literal_end;
2690-
call_stack_size = (uint32_t) (args_p->register_end + args_p->stack_limit);
2690+
call_stack_size = (uint32_t) args_p->stack_limit;
26912691
}
26922692

26932693
frame_ctx.bytecode_header_p = bytecode_header_p;

0 commit comments

Comments
 (0)