[UBsan] Skip -fsanitize=vptr instrumentations when the pointer value is null.
authorAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Jul 2014 18:15:39 +0000 (18:15 +0000)
committerAlexey Samsonov <vonosmas@gmail.com>
Fri, 18 Jul 2014 18:15:39 +0000 (18:15 +0000)
commit32f59d8e1eaf89774efa65fa03c75e9f5bcd7f13
tree1a0e229ada46580d3cc89406196ed14a74826d87
parent6c12414358031407667b75657b9d768080f16409
[UBsan] Skip -fsanitize=vptr instrumentations when the pointer value is null.

Otherwise -fsanitize=vptr causes the program to crash when it downcasts
a null pointer.

Reviewed in http://reviews.llvm.org/D4412.
Patch by Byoungyoung Lee!

llvm-svn: 213393
clang/lib/CodeGen/CGExpr.cpp
clang/test/CodeGenCXX/catch-undef-behavior.cpp