Skip to content

Commit 2c247b7

Browse files
committed
Fix a -Wmaybe-uninitialized warning
`MDWrapper::get` may not fill its argument in error cases, so initialize `Arg` to an all-ones value.
1 parent 20a1fd7 commit 2c247b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4491,7 +4491,7 @@ bool LLVMToSPIRVBase::transExecutionMode() {
44914491
return false;
44924492

44934493
auto AddSingleArgExecutionMode = [&](ExecutionMode EMode) {
4494-
uint32_t Arg;
4494+
uint32_t Arg = ~0u;
44954495
N.get(Arg);
44964496
BF->addExecutionMode(BM->add(new SPIRVExecutionMode(BF, EMode, Arg)));
44974497
};

0 commit comments

Comments
 (0)