mesa: Fix NULL deref in optimizer when NumInstructions == 0.

Bug #24984.
This commit is contained in:
Eric Anholt 2009-11-20 21:42:06 +01:00
parent 48deddaa6f
commit c4e8918cd2

View file

@ -443,7 +443,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog)
* FOO tmpY, arg0, arg1;
*/
for (i = 0; i < prog->NumInstructions - 1; i++) {
for (i = 0; i + 1 < prog->NumInstructions; i++) {
const struct prog_instruction *mov = prog->Instructions + i;
if (mov->Opcode != OPCODE_MOV ||