aboutsummaryrefslogtreecommitdiff
path: root/glslang/MachineIndependent/SymbolTable.cpp
diff options
context:
space:
mode:
authorJohn Kessenich <cepheus@frii.com>2013-11-20 18:37:12 +0000
committerJohn Kessenich <cepheus@frii.com>2013-11-20 18:37:12 +0000
commit23bcc02a20ee0f081332695a0d0a90ab0f706e0e (patch)
treed527f3a770e02ee7ce634b813dc3204fc6949495 /glslang/MachineIndependent/SymbolTable.cpp
parente1dba1b59f9ec7777caf928ababa7eeb5fe3c4c5 (diff)
downloadglslang-23bcc02a20ee0f081332695a0d0a90ab0f706e0e.tar.gz
Add new convenience pool allocators for arbitrary types, and use them to keep all TSymbol content in the pool, so they don't have to be deleted.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@24148 e7fa87d3-cd2b-0410-9028-fcbf551c1848
Diffstat (limited to 'glslang/MachineIndependent/SymbolTable.cpp')
-rw-r--r--glslang/MachineIndependent/SymbolTable.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp
index a801193a..dcf84dc2 100644
--- a/glslang/MachineIndependent/SymbolTable.cpp
+++ b/glslang/MachineIndependent/SymbolTable.cpp
@@ -249,8 +249,10 @@ TVariable::TVariable(const TVariable& copyOf) : TSymbol(copyOf)
{
type.deepCopy(copyOf.type);
userType = copyOf.userType;
+ numExtensions = 0;
extensions = 0;
- setExtensions(copyOf.numExtensions, copyOf.extensions);
+ if (copyOf.numExtensions > 0)
+ setExtensions(copyOf.numExtensions, copyOf.extensions);
if (! copyOf.unionArray.empty()) {
assert(!copyOf.type.getStruct());
@@ -276,8 +278,10 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
parameters.back().copyParam(copyOf.parameters[i]);
}
- extensions = 0;
- setExtensions(copyOf.numExtensions, copyOf.extensions);
+ numExtensions = 0;
+ extensions = 0;
+ if (copyOf.extensions > 0)
+ setExtensions(copyOf.numExtensions, copyOf.extensions);
returnType.deepCopy(copyOf.returnType);
mangledName = copyOf.mangledName;
op = copyOf.op;