================
@@ -563,9 +592,14 @@ void FactsGenerator::VisitCXXFunctionalCastExpr(
void FactsGenerator::VisitInitListExpr(const InitListExpr *ILE) {
if (!hasOrigins(ILE))
return;
- // For list initialization with a single element, like `View{...}`, the
- // origin of the list itself is the origin of its single element.
- if (ILE->getNumInits() == 1)
+ // For list initialization with a single element of the same type, like
+ // `View{other}`, the origin of the list itself is the origin of its single
+ // element.
+ //
+ // TODO: Handle aggregate (record/array) list initialization.
+ if (ILE->getNumInits() == 1 &&
+ ILE->getType().getCanonicalType() ==
+ ILE->getInit(0)->getType().getCanonicalType())
killAndFlowOrigin(*ILE, *ILE->getInit(0));
}
----------------
aeft wrote:
Without the type check, it crashes in
`placement_new_pointer_field_from_dead_scope`. This is because record types now
have origins, and in that function `src` and `dst` have different pointee-chain
lengths, which fails the assertion in `flow()`.
https://github.com/llvm/llvm-project/pull/195603
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits