rdar://68954187
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm always in favor of bugfixes. However, I have some concerns about this one.
clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp | ||
---|---|---|
169–171 | What a madness, we deal with every binary operator kind here O.O Why do we get Undefined here? If we don't model something - theoretically - we should get Unknown. | |
clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp | ||
331 | So, there are some corner cases already. Shouldn't put your mock 'implementation' to a different place? |
clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp | ||
---|---|---|
331 | evalAPSInt is called in a lot of different contexts, I don't know how else to ensure that it won't crash on BO_Cmp in all of those contexts. |
clang/lib/StaticAnalyzer/Core/BasicValueFactory.cpp | ||
---|---|---|
331 | I don't know. It doesn't feel like a strong argument. I still don't feel that this is the right direction. |
clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp | ||
---|---|---|
169–171 | Yes we should get Unknown. We should only return Undefined when there's undefined behavior in the program. Sounds like returning nullptr from BasicValueFactory causes SValBuilder to produce Undefined instead. I believe this needs to be fixed in SValBuilder instead. |
clang/test/Analysis/PR47511.cpp | ||
---|---|---|
5 | For such a simple test, there is no need to use the full-fledged header, the following would suffice: namespace std { struct strong_ordering { int n; constexpr operator int() const { return n; } static const strong_ordering equal, greater, less; }; constexpr strong_ordering strong_ordering::equal = { 0 }; constexpr strong_ordering strong_ordering::greater = { 1 }; constexpr strong_ordering strong_ordering::less = { -1 }; } // namespace std |
What a madness, we deal with every binary operator kind here O.O
Why do we get Undefined here? If we don't model something - theoretically - we should get Unknown.
I'm confused.