]> granicus.if.org Git - clang/commit
Sanitize upcasts and conversion to virtual base.
authorAlexey Samsonov <vonosmas@gmail.com>
Mon, 13 Oct 2014 23:59:00 +0000 (23:59 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Mon, 13 Oct 2014 23:59:00 +0000 (23:59 +0000)
commit52de81f78d920e5b65954f34119345ba485ef60c
treeac363f23e07024fc3844a6dd473e6fa5f81a9675
parent8fe0cabb93d385022e3cf5c3a9f0fc9f491ef827
Sanitize upcasts and conversion to virtual base.

This change adds UBSan check to upcasts. Namely, when we
perform derived-to-base conversion, we:
1) check that the pointer-to-derived has suitable alignment
   and underlying storage, if this pointer is non-null.
2) if vptr-sanitizer is enabled, and we perform conversion to
   virtual base, we check that pointer-to-derived has a matching vptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219642 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGClass.cpp
lib/CodeGen/CGExpr.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenFunction.h
test/CodeGenCXX/catch-undef-behavior.cpp