diff options
Diffstat (limited to 'source/compiler-core')
| -rw-r--r-- | source/compiler-core/slang-dxc-compiler.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/compiler-core/slang-dxc-compiler.cpp b/source/compiler-core/slang-dxc-compiler.cpp index 6619d000c..52933eaa7 100644 --- a/source/compiler-core/slang-dxc-compiler.cpp +++ b/source/compiler-core/slang-dxc-compiler.cpp @@ -599,16 +599,19 @@ SlangResult DXCDownstreamCompiler::getVersionString(slang::IBlob** outVersionStr versionString.append("."); versionString.append(minor); - char* commitHash; + char* commitHash = nullptr; uint32_t unused; versionInfo2->GetCommitInfo(&unused, &commitHash); + if (commitHash) + { + // Successfully queried the commit hash, append to the version and return. + versionString.append(commitHash); + CoTaskMemFree(commitHash); - versionString.append(commitHash); - CoTaskMemFree(commitHash); - - version = StringBlob::create(versionString.getBuffer()); - *outVersionString = version.detach(); - return SLANG_OK; + version = StringBlob::create(versionString.getBuffer()); + *outVersionString = version.detach(); + return SLANG_OK; + } } } |
