[PATCH] D52750: [Diagnostics] Check for integer overflow in array size expressions

Dávid Bolvanský via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 6 10:58:51 PDT 2018


xbolva00 added inline comments.


================
Comment at: lib/Sema/SemaType.cpp:2232
+
+      if (isa<BinaryOperator>(ArraySize))
+        ArraySize->EvaluateForOverflow(Context);
----------------
Rakete1111 wrote:
> What's up with this statement? Why is it needed? This won't handle overflows for unary expression for example.
Ok, I should use Sema::CheckForIntOverflow

But anyway, CheckForIntOverflow does not care about UnaryOperator either currently :)


https://reviews.llvm.org/D52750





More information about the cfe-commits mailing list