Avoid double-free in functions cloned for vulkan relaxed mode (#2987)
* Avoid double-free in functions cloned for vulkan relaxed mode When rewriting function calls atomicCounterIncrement and atoicCounterDecrement, clone the parameters so that the TParameter 'type' field is cloned. This avoids double-free when both the original and transformed functions are deleted by the parser. Fixes a ubsan failure.
This commit is contained in:
parent
f0ce653a25
commit
f28022c9f9
3 changed files with 9 additions and 6 deletions
|
|
@ -383,7 +383,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
|
|||
for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
|
||||
TParameter param;
|
||||
parameters.push_back(param);
|
||||
parameters.back().copyParam(copyOf.parameters[i]);
|
||||
(void)parameters.back().copyParam(copyOf.parameters[i]);
|
||||
}
|
||||
|
||||
extensions = nullptr;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue