[all-commits] [llvm/llvm-project] 9ece72: [clang] VisitCastExpr - use cast<> instead of dyn_...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Fri Feb 11 02:51:56 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ece72c159720d1c771249f5a565f6ca39a31ae3
      https://github.com/llvm/llvm-project/commit/9ece72c159720d1c771249f5a565f6ca39a31ae3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-02-11 (Fri, 11 Feb 2022)

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

  Log Message:
  -----------
  [clang] VisitCastExpr - use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is always dereferenced, so assert the cast is correct (which it should be as we just created that ScalableVectorType) instead of returning nullptr




More information about the All-commits mailing list