diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-24 00:54:33 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-24 00:54:33 +0000 |
commit | 69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548 (patch) | |
tree | 99c23222a860523fcf5ca4ac986547cfd99f3782 /clang/lib/CodeGen/CGExprAgg.cpp | |
parent | 6167ab281965d4ebbcff77c1f392050bcd1c5e79 (diff) | |
download | bcm5719-llvm-69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548.tar.gz bcm5719-llvm-69d0d2626a4f548b5a428f4e0f5c3f1fe65a2548.zip |
New -fcatch-undefined-behavior features:
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check
* check that references are bound to appropriate storage
* check that 'this' has appropriate storage in member accesses and member function calls
llvm-svn: 162523
Diffstat (limited to 'clang/lib/CodeGen/CGExprAgg.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprAgg.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp index 287b6dd8c7c..b5628b5e96c 100644 --- a/clang/lib/CodeGen/CGExprAgg.cpp +++ b/clang/lib/CodeGen/CGExprAgg.cpp @@ -549,8 +549,10 @@ AggExprEmitter::VisitCompoundLiteralExpr(CompoundLiteralExpr *E) { void AggExprEmitter::VisitCastExpr(CastExpr *E) { switch (E->getCastKind()) { case CK_Dynamic: { + // FIXME: Can this actually happen? We have no test coverage for it. assert(isa<CXXDynamicCastExpr>(E) && "CK_Dynamic without a dynamic_cast?"); - LValue LV = CGF.EmitCheckedLValue(E->getSubExpr()); + LValue LV = CGF.EmitCheckedLValue(E->getSubExpr(), + CodeGenFunction::CT_Load); // FIXME: Do we also need to handle property references here? if (LV.isSimple()) CGF.EmitDynamicCast(LV.getAddress(), cast<CXXDynamicCastExpr>(E)); |