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:
@@ -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()]++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user