aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/ExprEngine.cpp
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2011-07-15 20:29:02 +0000
committerJordy Rose <jediknil@belkadan.com>2011-07-15 20:29:02 +0000
commit8f08426e6f54ed20b959018f24dbea106a00b4ad (patch)
tree54bb75070571e603eee7264423dce190cf9c91cb /lib/StaticAnalyzer/Core/ExprEngine.cpp
parente9b5d77b7bfd3e8bba05df9914a6e8c336d68ff3 (diff)
[analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/ExprEngine.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/ExprEngine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/ExprEngine.cpp b/lib/StaticAnalyzer/Core/ExprEngine.cpp
index cdf76bfa3e..ffe5f0b6cd 100644
--- a/lib/StaticAnalyzer/Core/ExprEngine.cpp
+++ b/lib/StaticAnalyzer/Core/ExprEngine.cpp
@@ -510,7 +510,10 @@ void ExprEngine::Visit(const Stmt* S, ExplodedNode* Pred,
break;
case Stmt::GNUNullExprClass: {
- MakeNode(Dst, S, Pred, GetState(Pred)->BindExpr(S, svalBuilder.makeNull()));
+ // GNU __null is a pointer-width integer, not an actual pointer.
+ const GRState *state = GetState(Pred);
+ state = state->BindExpr(S, svalBuilder.makeIntValWithPtrWidth(0, false));
+ MakeNode(Dst, S, Pred, state);
break;
}