gl4: fix nullptr dereference in GL4Shader::CompileProgram

A nullptr dereference will occur when the disassembly string is not
found, which will obviously happen on AMD. Check for the condition and
if it is not found, put a message indicating so.
This commit is contained in:
sephiroth99 2015-06-04 23:52:47 -04:00
parent 48ed0cb903
commit 1139a1b6ac
1 changed files with 5 additions and 1 deletions

View File

@ -424,7 +424,11 @@ bool GL4Shader::CompileProgram(std::string source) {
search_offset = p - search_start; search_offset = p - search_start;
++search_offset; ++search_offset;
} }
if (disasm_start) {
host_disassembly_ = std::string(disasm_start); host_disassembly_ = std::string(disasm_start);
} else {
host_disassembly_ = std::string("Shader disassembly not available.");
}
// Append to shader dump. // Append to shader dump.
if (FLAGS_dump_shaders.size()) { if (FLAGS_dump_shaders.size()) {