[all-commits] [llvm/llvm-project] e3e72a: Fix "pointer is null" static analyzer warnings. NFCI.

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Thu Jan 9 04:05:59 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e3e72a2619ccec9654ef9ad45e1e926841fbaa58
      https://github.com/llvm/llvm-project/commit/e3e72a2619ccec9654ef9ad45e1e926841fbaa58
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-09 (Thu, 09 Jan 2020)

  Changed paths:
    M clang/lib/CodeGen/CGObjCGNU.cpp

  Log Message:
  -----------
  Fix "pointer is null" static analyzer warnings. NFCI.

Assert that the pointers are non-null before dereferencing them.


  Commit: e315ce2bd3a5347ab58d50fab2d449e8a4e60e00
      https://github.com/llvm/llvm-project/commit/e315ce2bd3a5347ab58d50fab2d449e8a4e60e00
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-09 (Thu, 09 Jan 2020)

  Changed paths:
    M clang/lib/Sema/SemaCoroutine.cpp

  Log Message:
  -----------
  Fix "pointer is null" static analyzer warnings. NFCI.

Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.


Compare: https://github.com/llvm/llvm-project/compare/15c7fa4d11ee...e315ce2bd3a5


More information about the All-commits mailing list