r600/sfn: Fix null pointer deref in live range evalation
authorGert Wollny <gert.wollny@collabora.com>
Sun, 12 Apr 2020 14:43:23 +0000 (16:43 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Apr 2020 15:10:43 +0000 (15:10 +0000)
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>

src/gallium/drivers/r600/sfn/sfn_instruction_base.cpp

index 22dfa5739f52879455c5bc5c2a5af8d0522b55e0..acbc5650b1f1308f9d25dc2b9044b289b8054b58 100644 (file)
@@ -120,7 +120,8 @@ void Instruction::remap_registers(ValueRemapper& map)
 
 void Instruction::add_remappable_src_value(PValue *v)
 {
-   m_mappable_src_registers.push_back(v);
+   if (*v)
+      m_mappable_src_registers.push_back(v);
 }
 
 void Instruction::add_remappable_src_value(GPRVector *v)
@@ -130,7 +131,8 @@ void Instruction::add_remappable_src_value(GPRVector *v)
 
 void Instruction::add_remappable_dst_value(PValue *v)
 {
-   m_mappable_dst_registers.push_back(v);
+   if (v)
+      m_mappable_dst_registers.push_back(v);
 }
 
 void Instruction::add_remappable_dst_value(GPRVector *v)