Commit e5b65f17 by Henner Zeller Committed by Copybara-Service

Avoid uninitialized value in call_once implementation.

There is a path in which the guard_result_ member is
not initialized; this is benign as the code makes
sure that it only accesses an initialized state.

Static analysis tools (such as clang-tidy) might not
see that however, so to make them happy, initialize
that value.

PiperOrigin-RevId: 516876319
Change-Id: I1bd2e97ad9e1daaa1397f306df993de13f7e684e
parent 6d41348a
...@@ -123,7 +123,7 @@ class SchedulingHelper { ...@@ -123,7 +123,7 @@ class SchedulingHelper {
private: private:
base_internal::SchedulingMode mode_; base_internal::SchedulingMode mode_;
bool guard_result_; bool guard_result_ = false;
}; };
// Bit patterns for call_once state machine values. Internal implementation // Bit patterns for call_once state machine values. Internal implementation
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment