aco: zero-initialize Temp

Fixes dEQP-VK.transform_feedback.* crashes from accesses garbage
temporaries in emit_extract_vector().

Fixes: 85521061 ("aco: prepare helper functions for subdword handling")
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4463>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4463>
This commit is contained in:
Rhys Perry 2020-04-06 14:08:39 +01:00 committed by Marge Bot
parent 8dd6a51e80
commit 20a4b1461b
3 changed files with 3 additions and 2 deletions

View file

@ -274,7 +274,6 @@ Temp emit_extract_vector(isel_context* ctx, Temp src, uint32_t idx, RegClass dst
assert(src.bytes() > (idx * dst_rc.bytes()));
Builder bld(ctx->program, ctx->block);
auto it = ctx->allocated_vec.find(src.id());
/* the size check needs to be early because elements other than 0 may be garbage */
if (it != ctx->allocated_vec.end() && dst_rc.bytes() == it->second[idx].regClass().bytes()) {
if (it->second[idx].regClass() == dst_rc) {
return it->second[idx];

View file

@ -262,7 +262,7 @@ static constexpr RegClass v8b{RegClass::v8b};
* and SSA id.
*/
struct Temp {
Temp() = default;
Temp() noexcept : id_(0), reg_class(RegType::sgpr, 0) {}
constexpr Temp(uint32_t id, RegClass cls) noexcept
: id_(id), reg_class(cls) {}

View file

@ -103,6 +103,8 @@ struct ssa_info {
};
uint32_t label;
ssa_info() : label(0) {}
void add_label(Label new_label)
{
/* Since all labels which use "instr" use it for the same thing