[clang] [Clang] Overflow Pattern Exclusion - rename some patterns, enhance docs (PR #105709)

Vitaly Buka via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 23 17:21:20 PDT 2024


================
@@ -314,26 +314,55 @@ Currently, this option supports three overflow-dependent code idioms:
     unsigned long foo = -1UL; // No longer causes a negation overflow warning
     unsigned long bar = -2UL; // and so on...
 
-``post-decr-while``
+``unsigned-post-decr-while``
 
 .. code-block:: c++
 
-    /// -fsanitize-undefined-ignore-overflow-pattern=post-decr-while
+    /// -fsanitize-undefined-ignore-overflow-pattern=unsigned-post-decr-while
     unsigned char count = 16;
     while (count--) { /* ... */ } // No longer causes unsigned-integer-overflow sanitizer to trip
 
-``add-overflow-test``
+``add-signed-overflow-test,add-unsigned-overflow-test``
 
 .. code-block:: c++
 
-    /// -fsanitize-undefined-ignore-overflow-pattern=add-overflow-test
+    /// -fsanitize-undefined-ignore-overflow-pattern=add-(signed|unsigned)-overflow-test
     if (base + offset < base) { /* ... */ } // The pattern of `a + b < a`, and other re-orderings,
-                                            // won't be instrumented (same for signed types)
+                                            // won't be instrumented (signed or unsigned types)
+
+Of the two arithmetic overflow sanitizer kinds ``unsigned-integer-overflow``
----------------
vitalybuka wrote:

Not sure I understand this one:
```
Of the two arithmetic overflow sanitizer kinds ``unsigned-integer-overflow``
and ``signed-integer-overflow``, ignored overflow patterns exclude
instrumentation from one of them.
```

Can this be reworded.

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


More information about the cfe-commits mailing list