[all-commits] [llvm/llvm-project] 5d1e3e: [clang-tidy] SimplifyBooleanExprCheck - use cast<>...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Sat Feb 12 11:59:48 PST 2022


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

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp

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

The IfStmt pointer is always referenced inside the replaceCompoundReturnWithCondition call, so assert the cast is correct instead of returning nullptr




More information about the All-commits mailing list