[clang] [clang][Analyzer] Fix error path of builtin overflow (PR #136345)
Pavel Skripkin via cfe-commits
cfe-commits at lists.llvm.org
Sun Apr 20 06:17:19 PDT 2025
================
@@ -121,30 +120,24 @@ class BuiltinFunctionChecker : public Checker<eval::Call> {
} // namespace
-const NoteTag *BuiltinFunctionChecker::createBuiltinNoOverflowNoteTag(
- CheckerContext &C, bool BothFeasible, SVal Arg1, SVal Arg2,
- SVal Result) const {
- return C.getNoteTag([Result, Arg1, Arg2, BothFeasible](
- PathSensitiveBugReport &BR, llvm::raw_ostream &OS) {
+const NoteTag *BuiltinFunctionChecker::createBuiltinOverflowNoteTag(
+ CheckerContext &C, bool overflow, SVal Arg1, SVal Arg2, SVal Result) const {
+ return C.getNoteTag([Result, Arg1, Arg2, overflow](PathSensitiveBugReport &BR,
+ llvm::raw_ostream &OS) {
if (!BR.isInteresting(Result))
return;
- // Propagate interestingness to input argumets if result is interesting.
+ // Propagate interestingness to input arguments if result is interesting.
BR.markInteresting(Arg1);
BR.markInteresting(Arg2);
- if (BothFeasible)
+ if (overflow)
----------------
pskrgag wrote:
Redone code a bit, I guess, ternary now won't look better
https://github.com/llvm/llvm-project/pull/136345
More information about the cfe-commits
mailing list