Initialize stack
This commit is contained in:
parent
5685d0eb4d
commit
ab2e16fe09
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Stack *program_init(uint16_t stacksize)
|
Stack *program_init(uint16_t stacksize)
|
||||||
{
|
{
|
||||||
Stack *stack = malloc(sizeof(&stack) + sizeof(Instruction) * PROGRAM_MAXSIZE + sizeof(int16_t) * MAX_LABELS +
|
Stack *stack = calloc(1,sizeof(&stack) + sizeof(Instruction) * PROGRAM_MAXSIZE + sizeof(int16_t) * MAX_LABELS +
|
||||||
sizeof(uint16_t) * stacksize);
|
sizeof(uint16_t) * stacksize);
|
||||||
|
|
||||||
stack->stacksize = stacksize;
|
stack->stacksize = stacksize;
|
||||||
|
Loading…
Reference in New Issue
Block a user