Skip to content

Commit 35ff0e4

Browse files
svenvhdbudanov-cmplr
authored andcommitted
Fix a -Wmaybe-uninitialized warning
`MDWrapper::get` may not fill its argument in error cases, so initialize `Arg` to an all-ones value. Original commit: KhronosGroup/SPIRV-LLVM-Translator@2c247b7
1 parent b2bb581 commit 35ff0e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -4493,6 +4493,12 @@ bool LLVMToSPIRVBase::transExecutionMode() {
44934493
if (!BF)
44944494
return false;
44954495

4496+
auto AddSingleArgExecutionMode = [&](ExecutionMode EMode) {
4497+
uint32_t Arg = ~0u;
4498+
N.get(Arg);
4499+
BF->addExecutionMode(BM->add(new SPIRVExecutionMode(BF, EMode, Arg)));
4500+
};
4501+
44964502
switch (EMode) {
44974503
case spv::ExecutionModeContractionOff:
44984504
BF->addExecutionMode(BM->add(

0 commit comments

Comments
 (0)