diff options
author | Connor Abbott <[email protected]> | 2014-08-08 14:57:27 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2014-08-10 15:00:52 -0700 |
commit | 58007aec4193e3bdb38cafcfb2188dcbd8f18def (patch) | |
tree | a2c18f610193679ff1efff45774b3ea905d1c518 /src/mesa/drivers | |
parent | 59a26a0554583d611f8377d537f8feb55042c9ca (diff) |
i965/fs: don't read from uninitialized memory while assigning registers
Reviewed-by: Matt Turner <[email protected]>
Signed-off-by: Connor Abbott <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp index 3f273642200..2233621b3cd 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp @@ -56,9 +56,9 @@ fs_visitor::assign_regs_trivial() foreach_in_list(fs_inst, inst, &instructions) { assign_reg(hw_reg_mapping, &inst->dst, reg_width); - assign_reg(hw_reg_mapping, &inst->src[0], reg_width); - assign_reg(hw_reg_mapping, &inst->src[1], reg_width); - assign_reg(hw_reg_mapping, &inst->src[2], reg_width); + for (i = 0; i < inst->sources; i++) { + assign_reg(hw_reg_mapping, &inst->src[i], reg_width); + } } if (this->grf_used >= max_grf) { @@ -518,9 +518,9 @@ fs_visitor::assign_regs(bool allow_spilling) foreach_in_list(fs_inst, inst, &instructions) { assign_reg(hw_reg_mapping, &inst->dst, reg_width); - assign_reg(hw_reg_mapping, &inst->src[0], reg_width); - assign_reg(hw_reg_mapping, &inst->src[1], reg_width); - assign_reg(hw_reg_mapping, &inst->src[2], reg_width); + for (int i = 0; i < inst->sources; i++) { + assign_reg(hw_reg_mapping, &inst->src[i], reg_width); + } } ralloc_free(g); |