Commit 20a4b146 authored by Rhys Perry's avatar Rhys Perry Committed by Marge Bot
Browse files

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's avatarRhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann's avatarDaniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <mesa/mesa!4463>
Part-of: <mesa/mesa!4463>
parent 8dd6a51e
......@@ -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];
......
......@@ -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) {}
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment