This revision was automatically updated to reflect the committed changes.
Closed by commit rL297700: [ubsan] Add a nullability sanitizer (authored by
vedantk).
Changed prior to commit:
https://reviews.llvm.org/D30762?vs=91382&id=91658#toc
Repository:
rL LLVM
https://reviews.llvm.org/D30762
vsk updated this revision to Diff 91382.
vsk marked 4 inline comments as done.
vsk added a comment.
- Rework documentation, add better code comments, and tighten up some check
lines.
https://reviews.llvm.org/D30762
Files:
docs/UndefinedBehaviorSanitizer.rst
include/clang/Basic/Sanitizers.d
vsk marked 9 inline comments as done.
vsk added a comment.
The plan is to start off with -fsanitize=nullability, and then create a
nullability-pedantic group later if it's really necessary. I think I've
addressed all of the inline comments, and will upload a new diff shortly.
zaks.anna added inline comments.
Comment at: docs/UndefinedBehaviorSanitizer.rst:101
+ ``-fsanitize=nullability-assign``, and the argument check with
+ ``-fsanitize=nullability-arg``. While violating nullability rules does
+ not result in undefined behavior, it is oft
vsk added a comment.
One question for Anna (inline). I will update the diff with the
documentation/code comments/renaming fixes once I hear back. Thanks again for
the comments!
Comment at: docs/UndefinedBehaviorSanitizer.rst:101
+ ``-fsanitize=nullability-assign``, and th
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
zaks.anna added inline comments.
Comment at: docs/UndefinedBehaviorSanitizer.rst:101
+ ``-fsanitize=nullability-assign``, and the argument check with
+ ``-fsanitize=nullability-arg``. While violating nullability rules does
+ not result in undefined behavior, it is oft
vsk updated this revision to Diff 91180.
vsk added a comment.
- Add a test for the mixed _Nonnull arg + __attribute__((nonnull)) arg case.
- Reword docs per Adrian's comments, fix up doxygen comments, add better code
comments, drop redundant "Nullability" truthiness checks.
https://reviews.llvm
vsk marked 8 inline comments as done.
vsk added a comment.
Thanks for your comments, and sorry for jumping the gun earlier with an updated
diff. I'll attach a fixed-up diff shortly.
Comment at: lib/CodeGen/CGDecl.cpp:1911
+if (auto Nullability = Ty->getNullability(getConte
jroelofs added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1911
+if (auto Nullability = Ty->getNullability(getContext())) {
+ if (Nullability && *Nullability == NullabilityKind::NonNull) {
+SanitizerScope SanScope(this);
aprantl wrote:
>
vsk updated this revision to Diff 91100.
vsk added reviewers: aprantl, arphaman.
vsk added a comment.
- Improve the wording of the docs.
- Drop a weak test from 'ubsan-null-retval.m'.
https://reviews.llvm.org/D30762
Files:
docs/UndefinedBehaviorSanitizer.rst
include/clang/Basic/Sanitizers.d
aprantl added inline comments.
Comment at: docs/UndefinedBehaviorSanitizer.rst:98
+ pointer as a function parameter which is annotated with ``_Nonnull``,
+ or assigning null to a lvalue marked ``_Nonnull``. You can enable
+ just the return value check with ``-fsanitiz
vsk created this revision.
Teach UBSan how to detect violations of the _Nonnull annotation when
passing arguments to callees, in assignments, and in return stmts.
Because _Nonnull does not affect IRGen, the new checks are disabled by
default. The new driver flags are:
-fsanitize=nullability-ar
13 matches
Mail list logo