Skip to content

Commit b65ba24

Browse files
committed
Backport fix for global variables with array initializers.
Change-Id: I5b68b5a2db54af456cdb192ebf634198e40345d8
1 parent d805109 commit b65ba24

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2081,7 +2081,8 @@ LLVMToSPIRVBase::transValueWithoutDecoration(Value *V, SPIRVBasicBlock *BB,
20812081
}
20822082
}
20832083
}
2084-
if (BM->isAllowedToUseExtension(ExtensionID::SPV_KHR_untyped_pointers)) {
2084+
if (BM->isAllowedToUseExtension(ExtensionID::SPV_KHR_untyped_pointers) &&
2085+
!Init->getType()->isArrayTy()) {
20852086
BVarInit = transConstantUse(Init, transType(Init->getType()));
20862087
} else {
20872088
SPIRVType *TransTy = transType(Ty);

0 commit comments

Comments
 (0)