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

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 11 15:45:31 PDT 2018


rsmith added inline comments.


================
Comment at: lib/Sema/SemaType.cpp:2231
       }
+
+      if (isa<BinaryOperator>(ArraySize))
----------------
xbolva00 wrote:
> @rsmith what about this place for check?
This is still evaluating the expression twice. To avoid that, you need to change the existing code that calls the evaluator to ask it to produce overflow warnings as a side-effect rather than adding a new call to `CheckForIntOverflow`.


https://reviews.llvm.org/D52750





More information about the cfe-commits mailing list