Fixup leak of TString
authorDan Sinclair <dsinclair@chromium.org>
Wed, 20 Feb 2019 21:40:13 +0000 (16:40 -0500)
committerDan Sinclair <dsinclair@chromium.org>
Wed, 20 Feb 2019 21:40:13 +0000 (16:40 -0500)
In decomposeIntrinsic a new TString was being allocated and passed into
a TVariable. That string was leaking. This CL converts the new TString
to call NewPoolTString to allocate from the TString pool.

hlsl/hlslParseHelper.cpp

index c313372..213f236 100644 (file)
@@ -4607,7 +4607,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
         if (nullptr == symbol) {
             type.getQualifier().builtIn = builtin;
 
-            TVariable* variable = new TVariable(new TString(name), type);
+            TVariable* variable = new TVariable(NewPoolTString(name), type);
 
             symbolTable.insert(*variable);