I didn't check all the calls to "struct queue" in the code, but the ones in generate.c and obj-util.c assume that the queue can handle "size" pointers when created with a size of "size".
When looking at the code in z-queue.c, pushing "size" items in a queue of size "size" will not work:
For the last item, abort() will be called (which is quite ugly in itself -- it won't save the character state before quitting for example).
Fix: either allow one more item in the queue, or add +1 to queue size when calling q_new().
When looking at the code in z-queue.c, pushing "size" items in a queue of size "size" will not work:
Code:
void q_push(struct queue *q, uintptr_t item) { q->data[q->tail] = item; q->tail = (q->tail + 1) % q->size; if (q->tail == q->head) abort(); }
Fix: either allow one more item in the queue, or add +1 to queue size when calling q_new().
Comment