summaryrefslogtreecommitdiff
path: root/source/slang/slang-ir-util.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-02-10 09:01:59 -0800
committerGitHub <noreply@github.com>2023-02-10 09:01:59 -0800
commit6e7b424953ae6732d4863e887e7e452396095d71 (patch)
tree883ca4d168ba679bd7ffe197fa765c8b42b19c6b /source/slang/slang-ir-util.cpp
parentdf02f3f50f977112ca1fbb148cd48ee41d560f41 (diff)
Fix checking of `[BackwardDerivativeOf]` attribute. (#2640)
* Fix checking of `[BackwardDerivativeOf]` attribute. * Fix crash in `canInstHaveSideEffectAtAddress`. * Fix. * Revert fix. * Fix. --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-ir-util.cpp')
-rw-r--r--source/slang/slang-ir-util.cpp3
1 files changed, 3 insertions, 0 deletions
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))