martong added inline comments.
================
Comment at: clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp:1687
+ if (ArgValKnown) {
+ if (!KernelZeroSizePtrValue)
+ KernelZeroSizePtrValue =
----------------
martong wrote:
> This is a bit confusing for me. Perhaps alternatively we could have a free
> function `isInitialized(KernelZero...)` instead. Or maybe having a separate
> bool variable to indicate whether it was initialized could be cleaner?
Another idea: Adding a helper struct to contain the bool `initialized`? E.g.
(draft):
```
struct LazyOptional {
bool initialized = false;
Opt<int> value;
Opt& get();
void set(const Opt&);
};
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76830/new/
https://reviews.llvm.org/D76830
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits