Skip to content

Commit d75b3cf

Browse files
authored
Zero initialize local variables (KhronosGroup#5501)
Certain versions of GCC warn about these variables being potentially uninitialized when used. I believe this is a false-positive, but zero-init'ing them is a safe way to fix this.
1 parent 6b4f0c9 commit d75b3cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/opt/optimizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
560560
"--switch-descriptorset requires a from:to argument.");
561561
return false;
562562
}
563-
uint32_t from_set, to_set;
563+
uint32_t from_set = 0, to_set = 0;
564564
const char* start = pass_args.data();
565565
const char* end = pass_args.data() + pass_args.size();
566566

0 commit comments

Comments
 (0)