[all-commits] [llvm/llvm-project] 415874: [X86] Don't dereference a dyn_cast<> - use a cast<...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon May 17 07:59:11 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 41587466aaf239d061ad084114ec749cecbb2966
      https://github.com/llvm/llvm-project/commit/41587466aaf239d061ad084114ec749cecbb2966
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2021-05-17 (Mon, 17 May 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp

  Log Message:
  -----------
  [X86] Don't dereference a dyn_cast<> - use a cast<> instead. NFCI.

dyn_cast<> can return null if the cast fails, by using cast<> we assert that the cast is correct helping to avoid a potential null dereference.




More information about the All-commits mailing list