[all-commits] [llvm/llvm-project] 9f8c0d: DeclCXX - Fix getAs<> null-dereference static anal...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Jan 4 07:19:56 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9f8c0d15c7f706a124ba29e8f40dc1937cd5bd49
      https://github.com/llvm/llvm-project/commit/9f8c0d15c7f706a124ba29e8f40dc1937cd5bd49
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-01-04 (Mon, 04 Jan 2021)

  Changed paths:
    M clang/lib/AST/DeclCXX.cpp

  Log Message:
  -----------
  DeclCXX - Fix getAs<> null-dereference static analyzer warnings. NFCI.

getAs<> can return null if the cast is invalid, which can lead to null pointer deferences. Use castAs<> instead which will assert that the cast is valid.




More information about the All-commits mailing list