stackpointer bei reallocation neu setzen.

This commit is contained in:
Enno Rehling 2005-06-12 02:36:26 +00:00
parent 3d5c41a273
commit b2404889d8
1 changed files with 2 additions and 0 deletions

View File

@ -52,8 +52,10 @@ opstack_push(opstack ** stackp, variant data)
*stackp = stack;
}
if (stack->top - stack->begin == stack->size) {
int pos = stack->top - stack->begin;
stack->size += stack->size;
stack->begin = realloc(stack->begin, sizeof(variant) * stack->size);
stack->top = stack->begin + pos;
}
*stack->top++ = data;
}