aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-11-16 07:18:12 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-11-16 07:18:12 +0000
commitb755a9da095d2f2f04444797f1e1a9511693815b (patch)
tree88b70e3529191cf67ec4979bfca1f2e791f7eaa1 /lib/AST/ExprConstant.cpp
parent42583320cf7977fd474572b9fe78e13eaf45fb8f (diff)
Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of dereferencing such a pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 1451fd1119..699d81715e 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -3197,6 +3197,7 @@ bool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {
if (Info.Ctx.getTypeSize(DestType) != Info.Ctx.getTypeSize(SrcType))
return false;
+ LV.Designator.setInvalid();
LV.moveInto(Result);
return true;
}