aco: validate uninitialized operands
authorDaniel Schürmann <daniel@schuermann.dev>
Wed, 25 Mar 2020 10:03:33 +0000 (11:03 +0100)
committerDaniel Schürmann <daniel@schuermann.dev>
Fri, 3 Apr 2020 22:13:15 +0000 (23:13 +0100)
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4002>

src/amd/compiler/aco_validate.cpp

index 0fc80e6800883ee7383283a8b309488f85bdc4f8..469d8c069be9dfa9884f489daf2af7c0ed084b33 100644 (file)
@@ -154,6 +154,8 @@ void validate(Program* program, FILE * output)
                                    (flat && i == 1) || (instr->format == Format::MIMG && i == 1) ||
                                    ((instr->format == Format::MUBUF || instr->format == Format::MTBUF) && i == 1);
                check(can_be_undef, "Undefs can only be used in certain operands", instr.get());
+            } else {
+               check(instr->operands[i].isFixed() || instr->operands[i].isTemp() || instr->operands[i].isConstant(), "Uninitialized Operand", instr.get());
             }
          }