i965/fs: fix uninitialized memory access

Found while running shader-db under valgrind.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: "13.0 17.0" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
Lionel Landwerlin 2017-02-16 13:06:07 +00:00
parent 62c90492ef
commit a0ac118398

View file

@ -207,9 +207,8 @@ fs_visitor::register_coalesce()
channels_remaining = -1;
continue;
}
dst_reg_offset[offset] = inst->dst.offset / REG_SIZE;
if (inst->size_written > REG_SIZE)
dst_reg_offset[offset + 1] = inst->dst.offset / REG_SIZE + 1;
for (unsigned i = 0; i < MAX2(inst->size_written / REG_SIZE, 1); i++)
dst_reg_offset[offset + i] = inst->dst.offset / REG_SIZE + i;
mov[offset] = inst;
channels_remaining -= regs_written(inst);
}