[clang] [clang][dataflow] Copy records relative to the destination type for c… (PR #160557)
Samira Bakon via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 24 11:02:46 PDT 2025
bazuzi wrote:
> And the other copyRecord further down "copyRecord(*LocDst, Env.getResultObjectLocation(*S), Env)" is safe because there is a stricter check "DstDecl->isDerivedFrom(ReturnDecl)"?
Yes, the types there are already more restricted than the CompatibleTypes check inside of copyRecord. There may be some complex inheritance patterns that are compatible but not modeled because that check is more strict than necessary, but it is sufficient to make the copyRecord call safe, as far as I can tell.
Unrelated, I noticed a mistake in the comment before the copyRecord call I modified. I'll correct "destination object may be of a sibling derived class" to "source object may be of a sibling derived class" before merging.
https://github.com/llvm/llvm-project/pull/160557
More information about the cfe-commits
mailing list