[all-commits] [llvm/llvm-project] 3ebf3d: [analyzer] Simplify SVal for simple NonLoc->Loc ca...
Ding Fei via All-commits
all-commits at lists.llvm.org
Fri Sep 15 04:00:47 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 3ebf3dd30da219f9f9aee12f42d45d18d55e7580
https://github.com/llvm/llvm-project/commit/3ebf3dd30da219f9f9aee12f42d45d18d55e7580
Author: Ding Fei <fding at feysh.com>
Date: 2023-09-15 (Fri, 15 Sep 2023)
Changed paths:
M clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp
M clang/test/Analysis/symbol-simplification-nonloc-loc.cpp
Log Message:
-----------
[analyzer] Simplify SVal for simple NonLoc->Loc casts (#66463)
NonLoc symbolic SVal to Loc casts are not supported except for
nonloc::ConcreteInt.
This change simplifies the source SVals so that the more casts can go
through nonloc::ConcreteInt->loc::ConcreteInt path. For example:
```c
void test_simplified_before_cast_add(long long t1) {
long long t2 = t1 + 3;
if (!t2) {
int *p = (int *) t2;
clang_analyzer_eval(p == 0); // expected-warning{{TRUE}}
}
}
```
If simplified, `t2` is 0, resulting `p` is nullptr, otherwise `p` is
unknown.
Fixes #62232
More information about the All-commits
mailing list