Commit
0ed11e333147e280208d9d0b3ff3f39970547643 fixed a "use after free"
bug by getting the next pointer before deleting the current node.
Unfortunately, it also made "next" never get updated if i->need != need.
Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
struct intel_resolve_map *i, *next;
for (i = mt->hiz_map.next; i; i = next) {
+ next = i->next;
if (i->need != need)
continue;
func(intel, mt, i->level, i->layer);
- next = i->next;
intel_resolve_map_remove(i);
did_resolve = true;
}