Avoid double-free in functions cloned for vulkan relaxed mode (#2987)
authorDavid Neto <dneto@google.com>
Wed, 3 Aug 2022 00:07:01 +0000 (20:07 -0400)
committerGitHub <noreply@github.com>
Wed, 3 Aug 2022 00:07:01 +0000 (18:07 -0600)
commitf28022c9f99bec57043c7a4f53f3b361558bfa42
tree49f26d5da2f38eb5bb519920472140b34a0248f5
parentf0ce653a25726000d4f37d94de33b95f942ff657
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.
glslang/MachineIndependent/ParseHelper.cpp
glslang/MachineIndependent/SymbolTable.cpp
glslang/MachineIndependent/SymbolTable.h