C has no order of evaluation restrictions on function arguments, so we
attempted to realloc from new-size to new-size.
GLuint nr = p->program->Base.NumInstructions++;
if (nr >= p->nr_instructions) {
+ int new_nr_instructions = p->nr_instructions * 2;
+
p->program->Base.Instructions =
_mesa_realloc(p->program->Base.Instructions,
sizeof(struct prog_instruction) * p->nr_instructions,
- sizeof(struct prog_instruction) * (p->nr_instructions *= 2));
+ sizeof(struct prog_instruction) * new_nr_instructions);
+ p->nr_instructions = new_nr_instructions;
}
{