aco: fix stack buffer overflow in apply_sgprs()

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: cef7879719 ('aco: rewrite apply_sgprs()')
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2361
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3442>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3442>
This commit is contained in:
Rhys Perry
2020-01-17 11:35:20 +00:00
committed by Marge Bot
parent 9b2ccd6a0e
commit e151398de6

View File

@@ -2112,7 +2112,8 @@ void apply_sgprs(opt_ctx &ctx, aco_ptr<Instruction>& instr)
continue;
}
sgpr_ids[num_sgprs++] = sgpr.id();
if (new_sgpr)
sgpr_ids[num_sgprs++] = sgpr.id();
ctx.uses[sgpr_info_id]--;
ctx.uses[sgpr.id()]++;
}