From 6e7b424953ae6732d4863e887e7e452396095d71 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 10 Feb 2023 09:01:59 -0800 Subject: Fix checking of `[BackwardDerivativeOf]` attribute. (#2640) * Fix checking of `[BackwardDerivativeOf]` attribute. * Fix crash in `canInstHaveSideEffectAtAddress`. * Fix. * Revert fix. * Fix. --------- Co-authored-by: Yong He --- source/slang/slang-ir-util.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/slang/slang-ir-util.cpp') diff --git a/source/slang/slang-ir-util.cpp b/source/slang/slang-ir-util.cpp index af6fd8ac4..942c8f2f8 100644 --- a/source/slang/slang-ir-util.cpp +++ b/source/slang/slang-ir-util.cpp @@ -364,6 +364,8 @@ bool canAddressesPotentiallyAlias(IRGlobalValueWithCode* func, IRInst* addr1, IR bool isPtrLikeOrHandleType(IRInst* type) { + if (!type) + return false; switch (type->getOp()) { case kIROp_ComPtrType: @@ -413,6 +415,7 @@ bool canInstHaveSideEffectAtAddress(IRGlobalValueWithCode* func, IRInst* inst, I // If any pointer typed argument of the call inst may overlap addr, return true. for (UInt i = 0; i < call->getArgCount(); i++) { + SLANG_RELEASE_ASSERT(call->getArg(i)->getDataType()); if (isPtrLikeOrHandleType(call->getArg(i)->getDataType())) { if (canAddressesPotentiallyAlias(func, call->getArg(i), addr)) -- cgit v1.2.3