[all-commits] [llvm/llvm-project] c7fa4e: [analyzer] Fix null pointer deref in CastValueChecker

vabridgers via All-commits all-commits at lists.llvm.org
Tue Jun 7 10:35:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c7fa4e8a8bc41e52cc49a27e0495d67d730fa167
      https://github.com/llvm/llvm-project/commit/c7fa4e8a8bc41e52cc49a27e0495d67d730fa167
  Author: Vince Bridgers <vince.a.bridgers at gmail.com>
  Date:   2022-06-07 (Tue, 07 Jun 2022)

  Changed paths:
    M clang/lib/StaticAnalyzer/Checkers/CastValueChecker.cpp
    M clang/test/Analysis/cast-value-notes.cpp
    M clang/test/Analysis/cast-value-state-dump.cpp

  Log Message:
  -----------
  [analyzer] Fix null pointer deref in CastValueChecker

A crash was seen in CastValueChecker due to a null pointer dereference.

The fix uses QualType::getAsString to avoid the null dereference
when a CXXRecordDecl cannot be obtained. A small reproducer is added,
and cast value notes LITs are updated for the new debug messages.

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D127105




More information about the All-commits mailing list