mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 10:40:11 +01:00
aco: Fix convert_to_SDWA when instruction has 3 operands.
Previously, when the instruction had 3 operands, this would cause possible corruption because of writing to sdwa->sel[2]. This was noticed thanks to GCC 10's -Wstringop-overflow warning. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6436>
This commit is contained in:
parent
0d194a70c6
commit
f820dde201
1 changed files with 4 additions and 0 deletions
|
|
@ -238,6 +238,10 @@ aco_ptr<Instruction> convert_to_SDWA(chip_class chip, aco_ptr<Instruction>& inst
|
|||
}
|
||||
|
||||
for (unsigned i = 0; i < instr->operands.size(); i++) {
|
||||
/* SDWA only uses operands 0 and 1. */
|
||||
if (i >= 2)
|
||||
break;
|
||||
|
||||
switch (instr->operands[i].bytes()) {
|
||||
case 1:
|
||||
sdwa->sel[i] = sdwa_ubyte;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue