[all-commits] [llvm/llvm-project] df9ae8: [AVR] Fix null dereference warning. NFCI.

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Thu Oct 8 11:13:12 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: df9ae806bba497e9fd76ff0da74c1ab8ab08d75b
      https://github.com/llvm/llvm-project/commit/df9ae806bba497e9fd76ff0da74c1ab8ab08d75b
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-10-08 (Thu, 08 Oct 2020)

  Changed paths:
    M llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp

  Log Message:
  -----------
  [AVR] Fix null dereference warning. NFCI.

We were checking if the ConstantSDNode was null but then immediately dereferencing it afterward - fold these both into a single check. Use the APInt::ult() helper as well.

Found by clang static analyzer.


  Commit: 119a143699d03a27686ca4377afb0b60e0985031
      https://github.com/llvm/llvm-project/commit/119a143699d03a27686ca4377afb0b60e0985031
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-10-08 (Thu, 08 Oct 2020)

  Changed paths:
    M llvm/lib/Analysis/ScalarEvolution.cpp

  Log Message:
  -----------
  [Analysis] ScalarEvolution::getUMinFromMismatchedTypes - assert we've found the max type. NFCI.

Found by clang static analyzer.


  Commit: 8f0658ae67da6a115daac5587cca42b2f47a2f6f
      https://github.com/llvm/llvm-project/commit/8f0658ae67da6a115daac5587cca42b2f47a2f6f
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-10-08 (Thu, 08 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/Utils/CodeExtractor.cpp

  Log Message:
  -----------
  [Transforms] CodeExtractor::verifyAssumptionCache - don't dereference a dyn_cast<>. NFCI.

Use cast<> as we immediately dereference the pointer afterwards - cast<> will assert if we fail.

Prevents clang static analyzer warning that we could deference a null pointer.


Compare: https://github.com/llvm/llvm-project/compare/3cc1f1fc1d97...8f0658ae67da


More information about the All-commits mailing list