ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 13 Feb 2013 21:18:23 +0000 (21:18 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 13 Feb 2013 21:18:23 +0000 (21:18 +0000)
commit2c5868c334646d4cdc92589cea393a5012cdd813
treeac106767d283c9e5dc2c7204c7c179d48814faff
parent6c95b97bf6fb2dc3ec1e36963742d952f5b3b30b
ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,
base-to-derived casts have undefined behavior if the object is not actually an
instance of the derived type.

llvm-svn: 175078
clang/lib/CodeGen/CGClass.cpp
clang/lib/CodeGen/CGExpr.cpp
clang/lib/CodeGen/CGExprScalar.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/test/CodeGenCXX/catch-undef-behavior.cpp