@@ -932,8 +932,6 @@ TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char*
932
932
return childNode;
933
933
}
934
934
935
-
936
-
937
935
//
938
936
// Handle seeing a base.field dereference in the grammar.
939
937
//
@@ -7475,7 +7473,7 @@ void TParseContext::vkRelaxedRemapUniformMembers(const TSourceLoc& loc, const TP
7475
7473
7476
7474
ForEachOpaque(type, identifier,
7477
7475
[&publicType, &loc, this](const TType& type, const TString& path) {
7478
- TString& structMemberName = *(new TString (path));
7476
+ TString& structMemberName = *(NewPoolTString (path.c_str() ));
7479
7477
7480
7478
TArraySizes arraySizes = {};
7481
7479
if (type.getArraySizes()) arraySizes = *type.getArraySizes();
@@ -7504,30 +7502,29 @@ void TParseContext::vkRelaxedRemapUniformMembers(const TSourceLoc& loc, const TP
7504
7502
});
7505
7503
}
7506
7504
7507
- void TParseContext::vkRelaxedRemapFunctionParameter(const TSourceLoc& loc, TFunction* function, TParameter& param, std::vector<TParameter* >* newParams)
7505
+ void TParseContext::vkRelaxedRemapFunctionParameter(const TSourceLoc& loc, TFunction* function, TParameter& param, std::vector<int >* newParams)
7508
7506
{
7509
7507
function->addParameter(param);
7510
7508
7511
7509
if (!param.type->isStruct() || !param.type->containsOpaque())
7512
7510
return;
7513
7511
7514
-
7515
7512
ForEachOpaque(*param.type, (param.name ? *param.name : param.type->getFieldName()),
7516
7513
[function, param, newParams](const TType& type, const TString& path) {
7517
- TString* memberName = new TString (path);
7514
+ TString* memberName = NewPoolTString (path.c_str() );
7518
7515
7519
7516
TType* memberType = new TType();
7520
7517
memberType->shallowCopy(type);
7521
7518
memberType->getQualifier().storage = param.type->getQualifier().storage;
7522
7519
memberType->clearArraySizes();
7523
7520
7524
- TParameter* memberParam = new TParameter() ;
7525
- memberParam-> name = memberName;
7526
- memberParam-> type = memberType;
7527
- memberParam-> defaultValue = nullptr;
7528
- function->addParameter(* memberParam);
7521
+ TParameter memberParam = {} ;
7522
+ memberParam. name = memberName;
7523
+ memberParam. type = memberType;
7524
+ memberParam. defaultValue = nullptr;
7525
+ function->addParameter(memberParam);
7529
7526
if (newParams)
7530
- newParams->push_back(memberParam );
7527
+ newParams->push_back(function->getParamCount()-1 );
7531
7528
});
7532
7529
}
7533
7530
@@ -7583,7 +7580,7 @@ TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc
7583
7580
TParameter param = { NewPoolTString(accessChainTraverser.path.c_str()), new TType };
7584
7581
param.type->shallowCopy(intermTyped->getType());
7585
7582
7586
- std::vector<TParameter* > newParams = {};
7583
+ std::vector<int > newParams = {};
7587
7584
vkRelaxedRemapFunctionParameter(loc, function, param, &newParams);
7588
7585
7589
7586
if (intermTyped->getType().isOpaque())
@@ -7619,15 +7616,16 @@ TIntermNode* TParseContext::vkRelaxedRemapFunctionArgument(const TSourceLoc& loc
7619
7616
if (!newParams.empty())
7620
7617
remappedArgument = intermediate.makeAggregate(remappedArgument, loc);
7621
7618
7622
- for (TParameter* newParam : newParams)
7619
+ for (int paramIndex : newParams)
7623
7620
{
7621
+ TParameter& newParam = function->operator[](paramIndex);
7624
7622
TIntermSymbol* intermSymbol = nullptr;
7625
- TSymbol* symbol = symbolTable.find(*newParam-> name);
7623
+ TSymbol* symbol = symbolTable.find(*newParam. name);
7626
7624
if (symbol && symbol->getAsVariable())
7627
7625
intermSymbol = intermediate.addSymbol(*symbol->getAsVariable(), loc);
7628
7626
else
7629
7627
{
7630
- TVariable* variable = new TVariable(newParam-> name, *newParam-> type);
7628
+ TVariable* variable = new TVariable(newParam. name, *newParam. type);
7631
7629
intermSymbol = intermediate.addSymbol(*variable, loc);
7632
7630
}
7633
7631
0 commit comments