[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-12-28 Thread Stephan Bergmann via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL321518: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid (authored by sberg, committed by ). Changed prior to commit: https://reviews.llvm.org/D40295?vs=127676=128288#toc

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-12-20 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added reviewers: vsk, thakis. vsk accepted this revision. vsk added a comment. This revision is now accepted and ready to land. Thanks, lgtm. Could you wait a day or two before committing? IIRC Richard or Nico have a -fsanitize=vptr Chromium bot, and they may have further comments.

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-12-20 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg updated this revision to Diff 127676. sberg added a comment. added a small IR test https://reviews.llvm.org/D40295 Files: clang/lib/CodeGen/CGExpr.cpp clang/lib/CodeGen/CGExprCXX.cpp clang/lib/CodeGen/CodeGenFunction.h clang/test/CodeGenCXX/ubsan-vtable-checks.cpp

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-12-19 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a comment. I don't think any checks can be skipped in the newly-introduced calls to EmitTypeCheck. Clang uses EmitDynamicCast on arbitrary addresses, not just addresses which are known to be checked for alignment/etc. Regarding the test update, I think it makes sense to extend the

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-12-13 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. friendly ping; any input on my two questions maybe? https://reviews.llvm.org/D40295 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-11-24 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg updated this revision to Diff 124154. sberg added a comment. Oh, I'd meant to upload the version of the patch where the newly added calls to EmitTypeCheck use the default Alignment and SkippedChecks arguments, instead of explicitly skipping Alignment and ObjectSize checks. (That's the

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-11-21 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg added a comment. Some items I'm unclear about: - Should those additional calls to EmitTypeCheck be restricted via those SkippedChecks or not? - Maybe there's a better way to add tests for this than to try shoehorn it into the existing vptr.cpp? https://reviews.llvm.org/D40295

[PATCH] D40295: -fsanitize=vptr warnings on bad static types in dynamic_cast and typeid

2017-11-21 Thread Stephan Bergmann via Phabricator via cfe-commits
sberg created this revision. Herald added a subscriber: kubamracek. ...when such an operation is done on an object during con-/destruction. This adds a test case to compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp that, unlike the existing test cases there, wants to detect multiple UBSan