Skip to content
Snippets Groups Projects
  1. Mar 14, 2017
    • Vedant Kumar's avatar
      [ubsan] Add a nullability sanitizer · 60b8b697
      Vedant Kumar authored
      Teach UBSan to detect when a value with the _Nonnull type annotation
      assumes a null value. Call expressions, initializers, assignments, and
      return statements are all checked.
      
      Because _Nonnull does not affect IRGen, the new checks are disabled by
      default. The new driver flags are:
      
        -fsanitize=nullability-arg      (_Nonnull violation in call)
        -fsanitize=nullability-assign   (_Nonnull violation in assignment)
        -fsanitize=nullability-return   (_Nonnull violation in return stmt)
        -fsanitize=nullability          (all of the above)
      
      This patch builds on top of UBSan's existing support for detecting
      violations of the nonnull attributes ('nonnull' and 'returns_nonnull'),
      and relies on the compiler-rt support for those checks. Eventually we
      will need to update the diagnostic messages in compiler-rt (there are
      FIXME's for this, which will be addressed in a follow-up).
      
      One point of note is that the nullability-return check is only allowed
      to kick in if all arguments to the function satisfy their nullability
      preconditions. This makes it necessary to emit some null checks in the
      function body itself.
      
      Testing: check-clang and check-ubsan. I also built some Apple ObjC
      frameworks with an asserts-enabled compiler, and verified that we get
      valid reports.
      
      Differential Revision: https://reviews.llvm.org/D30762
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297700 91177308-0d34-0410-b5e6-96231b3b80d8
      60b8b697
    • Daniel Jasper's avatar
      clang-format: Make it very slighly more expensive to wrap between "= {". · ecff61e5
      Daniel Jasper authored
      This prevents unwanted fallout from r296664. Specifically in proto formatting,
      this changed:
        optional Aaaaaaaa aaaaaaaa = 12 [
          (aaa) = aaaa,
          (bbbbbbbbbbbbbbbbbbbbbbbbbb) = {
            aaaaaaaaaaaaaaaaa: true,
            aaaaaaaaaaaaaaaa: true
          }
        ];
      
      Into:
        optional Aaaaaaaa aaaaaaaa = 12 [
          (aaa) = aaaa,
          (bbbbbbbbbbbbbbbbbbbbbbbbbb) =
              {aaaaaaaaaaaaaaaaa: true, aaaaaaaaaaaaaaaa: true}
        ];
      
      Which is considered less readable. Generally, it seems preferable to
      format such dict literals as blocks rather than contract them to one
      line.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297696 91177308-0d34-0410-b5e6-96231b3b80d8
      ecff61e5
    • Eli Friedman's avatar
      Fix crash with interrupt attribute on ARM. · 370e396b
      Eli Friedman authored
      An indirect call has no associated function declaration.
      
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297694 91177308-0d34-0410-b5e6-96231b3b80d8
      370e396b
    • Juergen Ributzka's avatar
      Reapply [VFS] Ignore broken symlinks in the directory iterator. · 5aeef7a4
      Juergen Ributzka authored
      Modified the tests to accept any iteration order, to run only on Unix, and added
      additional error reporting to investigate SystemZ bot issue.
      
      The VFS directory iterator and recursive directory iterator behave differently
      from the LLVM counterparts. Once the VFS iterators hit a broken symlink they
      immediately abort. The LLVM counterparts don't stat entries unless they have to
      descend into the next directory, which allows to recover from this issue by
      clearing the error code and skipping to the next entry.
      
      This change adds similar behavior to the VFS iterators. There should be no
      change in current behavior in the current CLANG source base, because all
      clients have loop exit conditions that also check the error code.
      
      This fixes rdar://problem/30934619.
      
      Differential Revision: https://reviews.llvm.org/D30768
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@297693 91177308-0d34-0410-b5e6-96231b3b80d8
      5aeef7a4
  2. Mar 13, 2017
  3. Mar 12, 2017
  4. Mar 11, 2017
  5. Mar 10, 2017
Loading