Infrastructure: Protect against missing built-in symbol table generators.
authorJohn Kessenich <cepheus@frii.com>
Wed, 11 Jan 2017 21:24:56 +0000 (14:24 -0700)
committerJohn Kessenich <cepheus@frii.com>
Wed, 11 Jan 2017 21:24:56 +0000 (14:24 -0700)
glslang/Include/revision.h
glslang/MachineIndependent/ShaderLang.cpp

index 852dd2e..b70f657 100644 (file)
@@ -2,5 +2,5 @@
 // For the version, it uses the latest git tag followed by the number of commits.
 // For the date, it uses the current date (when then script is run).
 
-#define GLSLANG_REVISION "Overload400-PrecQual.1750"
-#define GLSLANG_DATE "06-Jan-2017"
+#define GLSLANG_REVISION "Overload400-PrecQual.1759"
+#define GLSLANG_DATE "11-Jan-2017"
index 469ae1e..dadac56 100644 (file)
@@ -296,6 +296,9 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable,  TS
 {
     std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
 
+    if (builtInParseables == nullptr)
+        return false;
+
     builtInParseables->initialize(version, profile, spvVersion);
 
     // do the common tables
@@ -342,6 +345,9 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf
 {
     std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
 
+    if (builtInParseables == nullptr)
+        return false;
+
     builtInParseables->initialize(*resources, version, profile, spvVersion, language);
     InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spvVersion, language, source, infoSink, symbolTable);
     builtInParseables->identifyBuiltIns(version, profile, spvVersion, language, symbolTable, *resources);
@@ -736,8 +742,9 @@ bool ProcessDeferred(
 
     // Add built-in symbols that are potentially context dependent;
     // they get popped again further down.
-    AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion,
-                              compiler->getLanguage(), source);
+    if (! AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spvVersion,
+                                    compiler->getLanguage(), source))
+        return false;
 
     //
     // Now we can process the full shader under proper symbols and rules.