Skip to content

Commit 8c83d03

Browse files
committed
fixup: Use Int32Ty for GEP struct index
Structs need to be indexed with i32 specifically, not SizeTy.
1 parent cd91ac2 commit 8c83d03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CGHLSLRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ std::optional<LValue> CGHLSLRuntime::emitBufferArraySubscriptExpr(
11491149
// be past the end of the in-memory object.
11501150
SmallVector<llvm::Value *, 2> Indices;
11511151
Indices.push_back(Idx);
1152-
Indices.push_back(llvm::ConstantInt::get(Idx->getType(), 0));
1152+
Indices.push_back(llvm::ConstantInt::get(CGF.Int32Ty, 0));
11531153

11541154
llvm::Value *GEP = CGF.Builder.CreateGEP(LayoutTy, Addr.emitRawPointer(CGF),
11551155
Indices, "cbufferidx");

0 commit comments

Comments
 (0)