diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-03 06:04:23 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2008-11-03 06:04:23 +0000 |
commit | f8fc414bc0eaef8be964ec3a05446b2f6707eae3 (patch) | |
tree | 5a81809719541f677e96b230f47960c531ce6bd7 | |
parent | 4230da6fc517ee2a0568dba969060cb90a9ac87c (diff) |
Add some notes for SCA.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58597 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/NOTES.TXT | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/Analysis/NOTES.TXT b/lib/Analysis/NOTES.TXT index 97b7bf7c01..54ce078c1d 100644 --- a/lib/Analysis/NOTES.TXT +++ b/lib/Analysis/NOTES.TXT @@ -22,3 +22,34 @@ One is PredefinedExpr. //===----------------------------------------------------------------------===// Remove PersistentSValPairs and PersistentSVals? + +//===----------------------------------------------------------------------===// + +If the pointer is symbolic, we should expand it to a full region with symbolic +values. This can eliminate the following false warning. + +struct file { + int lineno; +}; + +struct file *fileinfo; + +void f10() { + int i; + int *p = 0; + + if (fileinfo->lineno) + p = &i; + + if (fileinfo->lineno) + *p = 3; // false warning +} + +Now we return a symbolic region for fileinfo->lineno in RegionStore. Loading +from it returns an UnknownVal. Therefore the path condition is not recorded. + +Where should we call this ExpandSymbolicPointer method? Perhaps in +GRExprEngine::VisitMemberExpr(). + +Problem: The base expr of MemberExpr can be in various form. How do we get the +pointer varregion(or other kind of region) to be changed? |