Initialize stack

This commit is contained in:
bʰedoh₂ swé 2024-06-17 05:48:07 +05:00
parent 5685d0eb4d
commit ab2e16fe09

View File

@ -8,7 +8,7 @@
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);
stack->stacksize = stacksize;