Commit 7f0bcfd8 by John Kessenich

Fix #1333: Protect against -g for non-generating code.

parent a89f8cf7
...@@ -729,6 +729,9 @@ void SetMessageOptions(EShMessages& messages) ...@@ -729,6 +729,9 @@ void SetMessageOptions(EShMessages& messages)
// //
void CompileShaders(glslang::TWorklist& worklist) void CompileShaders(glslang::TWorklist& worklist)
{ {
if (Options & EOptionDebug)
Error("cannot generate debug information unless linking to generate code");
glslang::TWorkItem* workItem; glslang::TWorkItem* workItem;
if (Options & EOptionStdin) { if (Options & EOptionStdin) {
worklist.remove(workItem); worklist.remove(workItem);
......
...@@ -619,7 +619,7 @@ public: ...@@ -619,7 +619,7 @@ public:
return semanticNameSet.insert(name).first->c_str(); return semanticNameSet.insert(name).first->c_str();
} }
void setSourceFile(const char* file) { sourceFile = file; } void setSourceFile(const char* file) { if (file != nullptr) sourceFile = file; }
const std::string& getSourceFile() const { return sourceFile; } const std::string& getSourceFile() const { return sourceFile; }
void addSourceText(const char* text) { sourceText = sourceText + text; } void addSourceText(const char* text) { sourceText = sourceText + text; }
const std::string& getSourceText() const { return sourceText; } const std::string& getSourceText() const { return sourceText; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment