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

2017-10-03 Thread Vedant Kumar via Phabricator via cfe-commits
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

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

2017-10-03 Thread Peter Collingbourne via Phabricator via cfe-commits
pcc added a comment. Wouldn't we get false positives if there is an indirect call in C++ code that calls into C code (or vice versa)? 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 b

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

2017-10-03 Thread Vedant Kumar via Phabricator via cfe-commits
vsk added a reviewer: arphaman. vsk added a comment. Ping. https://reviews.llvm.org/D38210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-09-25 Thread Vedant Kumar via Phabricator via cfe-commits
vsk updated this revision to Diff 116453. vsk added a comment. - Remove some noisy changes. https://reviews.llvm.org/D38210 Files: docs/UndefinedBehaviorSanitizer.rst lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h tes

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

2017-09-25 Thread Vedant Kumar via Phabricator via cfe-commits
vsk created this revision. The function sanitizer relies on RTTI to check callee types, but this scheme doesn't work well in languages without the ODR. This patch introduces a simple, best-effort function type encoding which can be used when RTTI isn't available. In this scheme, function types ar