[PATCH] D38210: [ubsan] Port the function sanitizer to C
Vedant Kumar via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 25 05:04:20 PDT 2017
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 are encoded within 32 bits. The return type and all parameter
types are recorded using a 3-bit encoding. Zero is a special value in
the 3-bit encoding which means "there is either no type here OR any type
would be permissible here".
This scheme allows false negatives, but not false positives. It's simple
and does not require any changes to the instrumentation.
Testing: I've found some minor issues with the new check, and no FPs.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9189 bytes
Desc: not available
More information about the cfe-commits