Skip to content
Commit 8b8d3623 authored by Akira Hatanaka's avatar Akira Hatanaka
Browse files

[CodeGen][ObjC] Adjust the addresses passed to calls to synthesized

copy/move constructor/assignment operator functions for non-trivial C
structs.

This commit fixes a bug where the offset of struct fields weren't being
taken into account when computing the addresses passed to calls to the
special functions.

For example, the copy constructor for S1 (__copy_constructor_8_8_s0_s8)
would pass the start addresses of the destination and source structs to
the call to S0's copy constructor (_copy_constructor_8_8_s0) without
adding the offset of field f1 to the addresses.

typedef struct {
  id f0;
  S0 f1;
} S1;

void test(S1 s1) {
  S1 t = s1;
}

rdar://problem/49400610

llvm-svn: 357229
parent 801cc327
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment