[qfcc] Make ivar-struct-return fail

It turns out that assignments to struct fields are not counted as live
when the whole struct is later used via a pointer move.
This commit is contained in:
Bill Currie 2020-03-17 23:34:37 +09:00
parent 22cd39c853
commit 43ea34535e
2 changed files with 8 additions and 5 deletions

View file

@ -1,4 +1,5 @@
#pragma bug die
#include "test-harness.h"
struct Point {
int x;
@ -11,18 +12,18 @@ typedef struct Point Point;
int foo;
Point origin;
}
-(Point) origin;
+(Point) origin;
@end
@implementation Object
-(Point) origin
+(Point) origin
{
origin = nil;
origin = {1, 2};
return origin;
}
@end
void __obj_exec_class (struct obj_module *msg) = #0;
int main()
{
return 0; // to survive and prevail
Point p = [Object origin];
return !(p.x == 1 && p.y == 2);
}

View file

@ -5,3 +5,5 @@ string strerror (int err) = #0;
void exit (int code) = #0;
entity spawn (void) = #0;
void remove (entity e) = #0;
id obj_msgSend (id receiver, SEL op, ...) = #0;
void __obj_exec_class (struct obj_module *msg) = #0;