[all-commits] [llvm/llvm-project] f0f445: [clang][sema] Sema::CheckFreeArguments - use cast<...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Sat Feb 12 03:19:12 PST 2022


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

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

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

The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr


  Commit: fbe0ca576d2b96c523182200529b5afbf709506f
      https://github.com/llvm/llvm-project/commit/fbe0ca576d2b96c523182200529b5afbf709506f
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-02-12 (Sat, 12 Feb 2022)

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

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

The pointer is referenced immediately, so assert the cast is correct instead of returning nullptr


Compare: https://github.com/llvm/llvm-project/compare/5e27487fc992...fbe0ca576d2b


More information about the All-commits mailing list