summaryrefslogtreecommitdiff
path: root/absl/base
diff options
context:
space:
mode:
authorGravatar Henner Zeller <hzeller@google.com>2023-03-15 11:09:56 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-03-15 11:10:48 -0700
commite5b65f172a2fbf488dc1927d86c8f3671d6b032f (patch)
tree964c88fe996469949c9e2a61d8c81ea2910d974f /absl/base
parent6d41348a3c07d5acd4060b4c873d0801a674d059 (diff)
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
Diffstat (limited to 'absl/base')
-rw-r--r--absl/base/call_once.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/base/call_once.h b/absl/base/call_once.h
index 96109f53..08436bac 100644
--- a/absl/base/call_once.h
+++ b/absl/base/call_once.h
@@ -123,7 +123,7 @@ class SchedulingHelper {
private:
base_internal::SchedulingMode mode_;
- bool guard_result_;
+ bool guard_result_ = false;
};
// Bit patterns for call_once state machine values. Internal implementation