glsl: Initialize ir_constant member const_elements in all constructors.
Fix defects reported by Coverity Scan. Uninitialized pointer field (UNINIT_CTOR) uninit_member: Non-static class member const_elements 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/6770>
This commit is contained in:
parent
a5967f308c
commit
3022cf3bac
|
@ -724,6 +724,7 @@ ir_constant::ir_constant(const struct glsl_type *type,
|
|||
ir_constant::ir_constant(float16_t f16, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT16, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -737,6 +738,7 @@ ir_constant::ir_constant(float16_t f16, unsigned vector_elements)
|
|||
ir_constant::ir_constant(float f, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -750,6 +752,7 @@ ir_constant::ir_constant(float f, unsigned vector_elements)
|
|||
ir_constant::ir_constant(double d, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_DOUBLE, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -763,6 +766,7 @@ ir_constant::ir_constant(double d, unsigned vector_elements)
|
|||
ir_constant::ir_constant(int16_t i16, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_INT16, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -776,6 +780,7 @@ ir_constant::ir_constant(int16_t i16, unsigned vector_elements)
|
|||
ir_constant::ir_constant(uint16_t u16, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_UINT16, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -789,6 +794,7 @@ ir_constant::ir_constant(uint16_t u16, unsigned vector_elements)
|
|||
ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -802,6 +808,7 @@ ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
|
|||
ir_constant::ir_constant(int integer, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -815,6 +822,7 @@ ir_constant::ir_constant(int integer, unsigned vector_elements)
|
|||
ir_constant::ir_constant(uint64_t u64, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_UINT64, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -828,6 +836,7 @@ ir_constant::ir_constant(uint64_t u64, unsigned vector_elements)
|
|||
ir_constant::ir_constant(int64_t int64, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_INT64, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
@ -841,6 +850,7 @@ ir_constant::ir_constant(int64_t int64, unsigned vector_elements)
|
|||
ir_constant::ir_constant(bool b, unsigned vector_elements)
|
||||
: ir_rvalue(ir_type_constant)
|
||||
{
|
||||
this->const_elements = NULL;
|
||||
assert(vector_elements <= 4);
|
||||
this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1);
|
||||
for (unsigned i = 0; i < vector_elements; i++) {
|
||||
|
|
Loading…
Reference in New Issue