Skip to content

Commit a33388f

Browse files
harden creating a call
1 parent ab99b33 commit a33388f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SPIRV/SPIRVUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,8 @@ bool postProcessBuiltinReturningStruct(Function *F) {
22492249
NewF->setCallingConv(F->getCallingConv());
22502250
auto Args = getArguments(CI);
22512251
Args.insert(Args.begin(), A);
2252-
CallInst *NewCI = Builder.CreateCall(NewF, Args, CI->getName());
2252+
CallInst *NewCI = Builder.CreateCall(
2253+
NewF, Args, NewF->getReturnType()->isVoidTy() ? "" : CI->getName());
22532254
NewCI->addParamAttr(0, SretAttr);
22542255
NewCI->setCallingConv(CI->getCallingConv());
22552256
SmallVector<User *, 32> UsersToReplace;

0 commit comments

Comments
 (0)