Fix -Wmaybe-uninitialized warnings

Fix some potentially uninitialized uses that are reported by GCC 13
with `-O3`.
This commit is contained in:
Sven van Haastregt 2023-06-06 15:07:43 +01:00 committed by arcady-lunarg
parent a6662c53ce
commit 4d95e22826
2 changed files with 4 additions and 3 deletions

View File

@ -1788,14 +1788,15 @@ public:
} }
// for block reference (first parameter must be EbtReference) // for block reference (first parameter must be EbtReference)
explicit TType(TBasicType t, const TType &p, const TString& n) : explicit TType(TBasicType t, const TType &p, const TString& n) :
basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), basicType(t), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), coopmat(false),
arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr), typeParameters(nullptr)
#ifndef GLSLANG_WEB #ifndef GLSLANG_WEB
, spirvType(nullptr) , spirvType(nullptr)
#endif #endif
{ {
assert(t == EbtReference); assert(t == EbtReference);
typeName = NewPoolTString(n.c_str()); typeName = NewPoolTString(n.c_str());
sampler.clear();
qualifier.clear(); qualifier.clear();
qualifier.storage = p.qualifier.storage; qualifier.storage = p.qualifier.storage;
referentType = p.clone(); referentType = p.clone();

View File

@ -382,7 +382,7 @@ TVariable* TVariable::clone() const
TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf) TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
{ {
for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) { for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
TParameter param; TParameter param{};
parameters.push_back(param); parameters.push_back(param);
(void)parameters.back().copyParam(copyOf.parameters[i]); (void)parameters.back().copyParam(copyOf.parameters[i]);
} }