Skip to content

Commit

Permalink
Fix nullptr issue in Pipeline::GetShaderDisassembly
Browse files Browse the repository at this point in the history
These two lines just needed to be swapped for this to not crash.
  • Loading branch information
Jasper-Bekkers authored and JaxLinAMD committed Dec 14, 2021
1 parent 201984f commit 5584bc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions icd/api/vk_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,6 @@ VkResult Pipeline::GetShaderDisassembly(
{
const PipelineBinaryInfo* pPipelineBinary = GetBinary();

// To extract the shader code, we can re-parse the saved ELF binary and lookup the shader's program
// instructions by examining the symbol table entry for that shader's entrypoint.
Util::Abi::PipelineAbiReader abiReader(pDevice->VkInstance()->Allocator(), pPipelineBinary->pBinary);

if (pPipelineBinary == nullptr)
{
// The pipelineBinary will be null if the pipeline wasn't created with
Expand All @@ -384,6 +380,10 @@ VkResult Pipeline::GetShaderDisassembly(
return VK_ERROR_UNKNOWN;
}

// To extract the shader code, we can re-parse the saved ELF binary and lookup the shader's program
// instructions by examining the symbol table entry for that shader's entrypoint.
Util::Abi::PipelineAbiReader abiReader(pDevice->VkInstance()->Allocator(), pPipelineBinary->pBinary);

VkResult result = VK_SUCCESS;
Pal::Result palResult = abiReader.Init();

Expand Down

0 comments on commit 5584bc5

Please sign in to comment.