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>
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);
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)
{
}