[PATCH] D30762: [ubsan] Add a nullability sanitizer

Filipe Cabecinhas via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 9 10:17:44 PST 2017


filcab added a comment.

Please make the tests tighter using `CHECK-NEXT` when possible. Much easier if later anyone needs to debug differences in IR.



================
Comment at: docs/UndefinedBehaviorSanitizer.rst:102
+     violating nullability rules does not result in undefined behavior, it
+     is often unintentional, so UBSan offers to catch it.
   -  ``-fsanitize=object-size``: An attempt to potentially use bytes which
----------------
This is weird. Please just document each of the `nullability-*` in isolation. None of the other flags is documenting more than one flag per bullet point, and I think splitting them up here is easy. It also makes it easier to read.
You already added the `nullability` group below, which mentions it adds the three checks.



================
Comment at: docs/UndefinedBehaviorSanitizer.rst:141
   -  ``-fsanitize=undefined``: All of the checks listed above other than
-     ``unsigned-integer-overflow``.
+     ``unsigned-integer-overflow`` and ``nullability``.
   -  ``-fsanitize=undefined-trap``: Deprecated alias of
----------------
```... and the ``nullability`` group.```


================
Comment at: test/CodeGenObjC/ubsan-nullability.m:114
+  // CHECK: [[NONULL]]:
+  // CHECK: ret i32*
+}
----------------
`CHECK-NEXT`?


https://reviews.llvm.org/D30762





More information about the cfe-commits mailing list