Skip to content

Commit

Permalink
Zero initialize local variables (#5501)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ben-clayton authored Dec 11, 2023
1 parent 6b4f0c9 commit d75b3cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/opt/optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
"--switch-descriptorset requires a from:to argument.");
return false;
}
uint32_t from_set, to_set;
uint32_t from_set = 0, to_set = 0;
const char* start = pass_args.data();
const char* end = pass_args.data() + pass_args.size();

Expand Down

0 comments on commit d75b3cf

Please sign in to comment.