[all-commits] [llvm/llvm-project] ce2b36: [clang] CheckSizelessVectorOperands - use castAs<>...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Mar 25 03:23:48 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce2b36e123e7b5312016b09c1b2971c9d80416e7
      https://github.com/llvm/llvm-project/commit/ce2b36e123e7b5312016b09c1b2971c9d80416e7
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

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

  Log Message:
  -----------
  [clang] CheckSizelessVectorOperands - use castAs<> instead of getAs<> to avoid dereference of nullptr

Move the only uses of the cast to where they are dereferenced.


  Commit: ae95f291e8d92bb7396219839efc0012a13378e1
      https://github.com/llvm/llvm-project/commit/ae95f291e8d92bb7396219839efc0012a13378e1
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-25 (Fri, 25 Mar 2022)

  Changed paths:
    M llvm/lib/CodeGen/AsmPrinter/AIXException.cpp

  Log Message:
  -----------
  [AsmPrinter] AIXException::endFunction - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is used immediately inside the getSymbol() call, so assert the cast is correct instead of returning nullptr


Compare: https://github.com/llvm/llvm-project/compare/19de2a5768d1...ae95f291e8d9


More information about the All-commits mailing list