[PATCH] D29369: [ubsan] Omit superflous overflow checks for promoted arithmetic (PR20193)

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 1 15:28:19 PST 2017


vsk marked an inline comment as done.
vsk added inline comments.


================
Comment at: lib/CodeGen/CGExprScalar.cpp:72
+  if (const auto *UO = dyn_cast<UnaryOperator>(Op.E))
+    return IsPromotedInteger(UO->getSubExpr());
+
----------------
efriedma wrote:
> Checking isPromotableIntegerType doesn't work the way you want it to; types can be "promoted" without actually widening them.  For example, enum types are promotable, and in C++ wchar_t is promotable.
Thanks for catching this! I have fixed the issue and will update this patch shortly.


https://reviews.llvm.org/D29369





More information about the cfe-commits mailing list