diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-10-18 22:20:20 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-10-18 22:20:20 +0000 |
commit | 6dfe2f544a5e601bd5ac1a7e31af17ec3bf1fe01 (patch) | |
tree | 9aa0e0aca3be85b934ab9906f46a4bc827b7478e /lib/Analysis/GRExprEngine.cpp | |
parent | 42e43a9eb334be2686619b401fc4cf33494ca82d (diff) |
Add support in GRExprEngine for UnaryOperator::AlignOf. This fixes one crash report in PR 2796.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index d122dca019..98fa58f5dd 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1780,6 +1780,23 @@ void GRExprEngine::VisitUnaryOperator(UnaryOperator* U, NodeTy* Pred, return; } + + case UnaryOperator::AlignOf: { + + QualType T = U->getSubExpr()->getType(); + + // FIXME: Add support for VLAs. + + if (!T.getTypePtr()->isConstantSizeType()) + return; + + uint64_t size = getContext().getTypeAlign(T) / 8; + const GRState* St = GetState(Pred); + St = SetSVal(St, U, NonLoc::MakeVal(getBasicVals(), size, U->getType())); + + MakeNode(Dst, U, Pred, St); + return; + } case UnaryOperator::SizeOf: { |