[PATCH] D38210: [ubsan] Port the function sanitizer to C

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 3 15:53:03 PDT 2017


vsk planned changes to this revision.
vsk added a comment.

In https://reviews.llvm.org/D38210#887635, @pcc wrote:

> Wouldn't we get false positives if there is an indirect call in C++ code that calls into C code (or vice versa)?


Ah, right, I'm surprised I didn't hit that while testing.

> I think I'd prefer it if we came up with a precise encoding of function types that was independent of RTTI, and use it in all languages. One possibility would be to represent each function type with an object of size 1 whose name contains the mangled function type, and use its address as the identity of the function type.

That makes sense. Like the RTTI object it could be made linkonce_odr.


https://reviews.llvm.org/D38210





More information about the cfe-commits mailing list