nrvo shouldn't touch bycopy object[backport:1.2] (#19385)

fix nim-lang#19342
This commit is contained in:
flywind 2022-01-14 00:39:17 +08:00 • committed by GitHub
commit 9b9ae8a487
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 1 deletions

12
tests/objects/m19342.c Normal file
View file

@ -0,0 +1,12 @@
struct Node
{
int data[25];
};
struct Node hello(int name) {
struct Node x = {999, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7 ,8, 9,
1, 2, 3, 4, 5};
return x;
}