Skip to content

Commit 1e84ea8

Browse files
jeffnnJeff Noyle
and
Jeff Noyle
authored
PIX: Null check before dyn_cast (microsoft#3654) (microsoft#3660)
dbg.value can occasionally return a null value. (Hit this in a customer (343) shader via PIX.) This is expected. From IntrinsicInst.cpp: // When the value goes to null, it gets replaced by an empty MDNode. Co-authored-by: Jeff Noyle <[email protected]>
1 parent 76e7647 commit 1e84ea8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/DxilPIXPasses/PixPassHelpers.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ using namespace hlsl;
2424

2525
namespace PIXPassHelpers {
2626
bool IsAllocateRayQueryInstruction(llvm::Value *Val) {
27-
if (llvm::Instruction *Inst = llvm::dyn_cast<llvm::Instruction>(Val)) {
28-
return hlsl::OP::IsDxilOpFuncCallInst(Inst,
29-
hlsl::OP::OpCode::AllocateRayQuery);
27+
if (Val != nullptr) {
28+
if (llvm::Instruction *Inst = llvm::dyn_cast<llvm::Instruction>(Val)) {
29+
return hlsl::OP::IsDxilOpFuncCallInst(Inst,
30+
hlsl::OP::OpCode::AllocateRayQuery);
31+
}
3032
}
3133
return false;
3234
}

0 commit comments

Comments
 (0)