Skip to content

Commit f441bbd

Browse files
ichenkaiigcbot
authored andcommitted
Fix assert due to 0 size
Fixed an assert in test cases due to a zero size is passed down to attribute build for RT.
1 parent aeefdeb commit f441bbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

IGC/AdaptorCommon/RayTracing/RTBuilder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,10 @@ void RTBuilder::setReturnAlignment(CallInst* CI, uint32_t AlignVal)
14991499

15001500
void RTBuilder::setDereferenceable(CallInst* CI, uint32_t Size)
15011501
{
1502-
CI->addRetAttr(Attribute::getWithDereferenceableBytes(CI->getContext(), Size));
1502+
if (Size)
1503+
{
1504+
CI->addRetAttr(Attribute::getWithDereferenceableBytes(CI->getContext(), Size));
1505+
}
15031506
}
15041507

15051508
Value* RTBuilder::getGlobalBufferPtr(IGC::ADDRESS_SPACE Addrspace)

0 commit comments

Comments
 (0)