glsl: Update loop_terminator constructor to accept parameters.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member continue_from_then is not
initialized in this constructor nor in any functions that it calls.

Suggested-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7283>
This commit is contained in:
Vinson Lee 2020-10-22 17:31:19 -07:00
parent f74ef15879
commit 7dc17ae5ab
2 changed files with 4 additions and 6 deletions

View file

@ -355,10 +355,8 @@ loop_terminator *
loop_variable_state::insert(ir_if *if_stmt, bool continue_from_then)
{
void *mem_ctx = ralloc_parent(this);
loop_terminator *t = new(mem_ctx) loop_terminator();
t->ir = if_stmt;
t->continue_from_then = continue_from_then;
loop_terminator *t = new(mem_ctx) loop_terminator(if_stmt,
continue_from_then);
this->terminators.push_tail(t);

View file

@ -194,8 +194,8 @@ public:
class loop_terminator : public exec_node {
public:
loop_terminator()
: ir(NULL), iterations(-1)
loop_terminator(ir_if *ir, bool continue_from_then)
: ir(ir), iterations(-1), continue_from_then(continue_from_then)
{
}