[all-commits] [llvm/llvm-project] 145f35: [clang][dataflow] fix failing assert in copyRecord

Paul Semel via All-commits all-commits at lists.llvm.org
Wed Jul 26 01:53:10 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 145f353fd67909e03c39b968b464ac625edde6cb
      https://github.com/llvm/llvm-project/commit/145f353fd67909e03c39b968b464ac625edde6cb
  Author: Paul Semel <semelpaul at gmail.com>
  Date:   2023-07-26 (Wed, 26 Jul 2023)

  Changed paths:
    M clang/lib/Analysis/FlowSensitive/RecordOps.cpp
    M clang/unittests/Analysis/FlowSensitive/RecordOpsTest.cpp

  Log Message:
  -----------
  [clang][dataflow] fix failing assert in copyRecord

When dealing with copy constructor, the compiler can emit an
UncheckedDerivedToBase implicit cast for the CXXConstructorExpr of the
base class. In such case, when trying to copy the src storage location
to its destination, we will fail on the assert checking that location
types are the same.

When copying from derived to base class, it is acceptable to break that
assumption to only copy common fields from the base class.

Note: the provided test crashes the process without the changes made to
copyRecord.

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




More information about the All-commits mailing list