brw: Avoid reading past the end of p->store

On the last iteration of the loop, `offset` will point to the location
just beyond the last instruction in the program. If the program exactly
fills `p->store` then calling `next_offset()` will read out of bounds.

Instead just let the inner while loop call `next_offset()` one
additional time.

Fixes: a35b9cb625 ("i965: Add annotation data structure and support code.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12486
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33101>
This commit is contained in:
Matt Turner
2025-01-16 22:27:00 -05:00
committed by Marge Bot
parent 27284d14fd
commit a4f0a96dda
-2
View File
@@ -2498,8 +2498,6 @@ brw_compact_instructions(struct brw_codegen *p, int start_offset,
}
group->offset = start_offset + offset;
offset = next_offset(devinfo, store, offset);
}
}