[cfe-commits] [Patch][Review] Bug 13329 - Incorrect code generated for automatic assignment operator
dgregor at apple.com
Tue Jul 17 00:24:37 CDT 2012
On Jul 16, 2012, at 3:43 AM, Jonathan Sauer <jonathan.sauer at gmx.de> wrote:
> attached is a patch (without tests) to fix <http://llvm.org/bugs/show_bug.cgi?id=13329>.
> With this patch, the llvm.memcpy instruction generated by clang only copy the whole struct
> if it is a POD. Otherwise they do no longer copy the tail padding as well, as it can and
> will be reused for the fields of derived classes.
> If the general approach to fixing this bug is ok I will add the necessary tests.
As noted in the PR:
This is definitely the right approach. A few specific comments:
- This change should affect the the EmitGCMemmoveCollectable call as well,
since the same bug exists there for Objective-C++ GC
- There are other CreateMemCpy calls in IR generation that likely need this
same computation. Please factor this computation into a separate routine and
update those callers
- Please include a test case that generates IR and checks that it does the
Thanks for working on this!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits