luken-google abandoned this revision.
luken-google added a comment.
seems to have fixed itself..
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141690/new/
https://reviews.llvm.org/D141690
___
cfe-commits
ilya-biryukov added inline comments.
Comment at: clang/lib/CodeGen/CGCall.cpp:1338
+ llvm::StructType *STy = dyn_cast(Val->getType());
+ if (STy && STy->canLosslesslyBitCastTo(Dest.getElementType())) {
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
luken-google added inline comments.
Comment at: clang/lib/CodeGen/CGCall.cpp:1338
+ llvm::StructType *STy = dyn_cast(Val->getType());
+ if (STy &&
STy->isLayoutIdentical(cast(Dest.getElementType( {
for (unsigned i = 0, e = STy->getNumElements(); i != e; ++i) {
---
luken-google updated this revision to Diff 489058.
luken-google added a comment.
Add newline at end of test file.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141690/new/
https://reviews.llvm.org/D141690
Files:
clang/docs/ReleaseNotes.rst
cla
luken-google updated this revision to Diff 489057.
luken-google added a comment.
Adds test and release note, refactors to avoid possible null pointer deref.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141690/new/
https://reviews.llvm.org/D141690
ilya-biryukov added a subscriber: jyknight.
ilya-biryukov added a comment.
Sorry, didn't see your comment when submitting mine.
I think the offending code is clearly wrong here and adding the
`isLayoutIdentical` seems like the right thing to do.
This looks like a small change and I'm happy to L
ilya-biryukov added a comment.
The change seems reasonable. Could you add a test with a crasher repro and some
validation of the generated IR?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141690/new/
https://reviews.llvm.org/D141690
luken-google added a comment.
See: https://github.com/llvm/llvm-project/issues/53983
I can add a release note and some testing, but wanted feedback that this was
the right approach. The problem is when generating code for the constructor for
the `bar` element inside of `MyStruct`, `Dest` has an
luken-google created this revision.
Herald added a project: All.
luken-google requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Fixes GH#53983.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141690
Files:
clang/lib/Code