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
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.
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
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
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
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
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
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