[all-commits] [llvm/llvm-project] 593671: Fix "pointer is null" static analyzer warning. NFCI.

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Jan 8 09:19:59 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5936717fa6537812257990143e2384bb78486ef9
      https://github.com/llvm/llvm-project/commit/5936717fa6537812257990143e2384bb78486ef9
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-08 (Wed, 08 Jan 2020)

  Changed paths:
    M clang/lib/CodeGen/CGOpenCLRuntime.cpp

  Log Message:
  -----------
  Fix "pointer is null" static analyzer warning. NFCI.

Use castAs<> instead of getAs<> since we know that the pointer will be valid (and is dereferenced immediately below).


  Commit: 19bfb6d8df6c23c8c8d19af9221d12bf08244b51
      https://github.com/llvm/llvm-project/commit/19bfb6d8df6c23c8c8d19af9221d12bf08244b51
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-08 (Wed, 08 Jan 2020)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyLowerEmscriptenEHSjLj.cpp

  Log Message:
  -----------
  Fix "pointer is null" static analyzer warning. NFCI.

Use cast<> instead of dyn_cast<> since we know that the pointer should be valid (and is dereferenced immediately below in the getSignature call).


  Commit: 46e2f89364ce24a06953d08c78218fb5548a9fa3
      https://github.com/llvm/llvm-project/commit/46e2f89364ce24a06953d08c78218fb5548a9fa3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-01-08 (Wed, 08 Jan 2020)

  Changed paths:
    M llvm/lib/MC/MCAssembler.cpp

  Log Message:
  -----------
  [MC] writeFragment - assert MCFragment::FT_Fill length is legal.

Silence (clang/MSVC) static analyzer warnings that the fragment data may either write out of bounds of the local array or reference uninitialized data.


Compare: https://github.com/llvm/llvm-project/compare/bbbbf8a1065e...46e2f89364ce


More information about the All-commits mailing list