Skip to content

Commit 31b15e3

Browse files
authored
PIX: Check for null HS entry point (pass-through case) (#4092)
With a null HS, just the patch constant function is present. PIX passes crash on the null, so this change suppresses that null return value.
1 parent 4b4b52a commit 31b15e3

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/DXIL/DxilModule.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ const Function *DxilModule::GetEntryFunction() const {
234234
llvm::SmallVector<llvm::Function *, 64> DxilModule::GetExportedFunctions() const {
235235
llvm::SmallVector<llvm::Function *, 64> ret;
236236
for (auto const& fn : m_DxilEntryPropsMap) {
237+
if (fn.first != nullptr) {
237238
ret.push_back(const_cast<llvm::Function*>(fn.first));
239+
}
238240
}
239241
return ret;
240242
}

lib/DxilPIXPasses/PixPassHelpers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,10 @@ std::vector<llvm::BasicBlock*> GetAllBlocks(hlsl::DxilModule& DM) {
203203
std::vector<llvm::BasicBlock*> ret;
204204
auto entryPoints = DM.GetExportedFunctions();
205205
for (auto& fn : entryPoints) {
206-
auto & blocks = fn->getBasicBlockList();
207-
for (auto & block : blocks) {
208-
ret.push_back(&block);
209-
}
206+
auto& blocks = fn->getBasicBlockList();
207+
for (auto& block : blocks) {
208+
ret.push_back(&block);
209+
}
210210
}
211211
return ret;
212212
}

0 commit comments

Comments
 (0)