[cfe-commits] r85492 - in /cfe/trunk: lib/Analysis/GRExprEngineInternalChecks.cpp test/Analysis/misc-ps.m
Ted Kremenek
kremenek at apple.com
Wed Oct 28 22:33:39 PDT 2009
Author: kremenek
Date: Thu Oct 29 00:33:39 2009
New Revision: 85492
URL: http://llvm.org/viewvc/llvm-project?rev=85492&view=rev
Log:
Fix accidental use of CheckSVal instead of CheckLocation, and add a
small test case to show we handle dereferences of undefined values.
Modified:
cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
cfe/trunk/test/Analysis/misc-ps.m
Modified: cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp?rev=85492&r1=85491&r2=85492&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngineInternalChecks.cpp Thu Oct 29 00:33:39 2009
@@ -763,7 +763,7 @@
public:
CheckUndefDeref() : BT(0) {}
- ExplodedNode *CheckSVal(const Stmt *S, ExplodedNode *Pred,
+ ExplodedNode *CheckLocation(const Stmt *S, ExplodedNode *Pred,
const GRState *state, SVal V, GRExprEngine &Eng);
static void *getTag() {
@@ -772,7 +772,7 @@
}
};
-ExplodedNode *CheckUndefDeref::CheckSVal(const Stmt *S, ExplodedNode *Pred,
+ExplodedNode *CheckUndefDeref::CheckLocation(const Stmt *S, ExplodedNode *Pred,
const GRState *state, SVal V,
GRExprEngine &Eng) {
GRStmtNodeBuilder &Builder = Eng.getBuilder();
Modified: cfe/trunk/test/Analysis/misc-ps.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps.m?rev=85492&r1=85491&r2=85492&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps.m (original)
+++ cfe/trunk/test/Analysis/misc-ps.m Thu Oct 29 00:33:39 2009
@@ -154,6 +154,12 @@
*p = 1; // no-warning
}
+// check deference of undefined values
+void check_deref_undef(void) {
+ int *p;
+ *p = 0xDEADBEEF; // expected-warning{{Dereference of undefined pointer value}}
+}
+
// PR 3422
void pr3422_helper(char *p);
void pr3422() {
More information about the cfe-commits
mailing list