[clang] [Clang] Add -fwrapv-pointer flag (PR #122486)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 14:31:54 PST 2025


================
@@ -4311,14 +4311,14 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E,
     // GEP indexes are signed, and scaling an index isn't permitted to
     // signed-overflow, so we use the same semantics for our explicit
     // multiply.  We suppress this if overflow is not undefined behavior.
-    if (getLangOpts().isSignedOverflowDefined()) {
+    if (getLangOpts().PointerOverflowDefined) {
       Idx = Builder.CreateMul(Idx, numElements);
----------------
efriedma-quic wrote:

Opened #124358 .

https://github.com/llvm/llvm-project/pull/122486


More information about the cfe-commits mailing list