Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() functions
and OVERRIDE_COMMON_FLAG macro, which are only supposed to be
called during initialization.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/sanitizer_common/sanitizer_flags.h | ||
---|---|---|
91 ↗ | (On Diff #17517) | Macro in a header file? You got to be kidding. |
Comment Actions
- Replace macro with a function.
lib/sanitizer_common/sanitizer_flags.h | ||
---|---|---|
91 ↗ | (On Diff #17517) | Replaced it with "OverrideCommonFlags()" function. Unfortunately, we can't atomically switch common_flags_dont_use singleton during tool initialization, and have to gradually update it by calls to SetCommonFlagsDefaults(), OverrideCommonFlags() and ParseCommonFlagsFromString(). |