glsl: Initialize ir_to_mesa_visitor members in constructor.
authorVinson Lee <vlee@freedesktop.org>
Thu, 8 Oct 2020 21:55:17 +0000 (14:55 -0700)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:07:24 +0000 (21:07 +0000)
Fix defects reported by Coverity Scan.

Uninitialized pointer field (UNINIT_CTOR)
uninit_member: Non-static class member ctx is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member prog is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member shader_program is not initialized in this constructor nor in any functions that it calls.
uninit_member: Non-static class member options is not initialized in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7071>

src/mesa/program/ir_to_mesa.cpp

index 3ee8490..c038473 100644 (file)
@@ -2190,6 +2190,10 @@ ir_to_mesa_visitor::ir_to_mesa_visitor()
    next_signature_id = 1;
    current_function = NULL;
    mem_ctx = ralloc_context(NULL);
+   ctx = NULL;
+   prog = NULL;
+   shader_program = NULL;
+   options = NULL;
 }
 
 ir_to_mesa_visitor::~ir_to_mesa_visitor()