[all-commits] [llvm/llvm-project] b81b3a: [lldb] TypeSystemClang - use castAs/cast<> instead...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Sat Jan 29 07:35:01 PST 2022


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

  Changed paths:
    M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

  Log Message:
  -----------
  [lldb] TypeSystemClang - use castAs/cast<> instead of getAs/dyn_cast<> to avoid dereference of nullptr

The pointers are dereferenced immediately, so assert the cast is correct instead of returning nullptr




More information about the All-commits mailing list