preventing Bad_footprint when passing struct value by reference

Reviewed By: jberdine

Differential Revision: D2912475

fb-gh-sync-id: 1dd5442
shipit-source-id: 1dd5442
master
Sam Blackshear 9 years ago committed by facebook-github-bot-1
parent 36cc1b0d2e
commit 5e9a21573b

@ -1362,7 +1362,7 @@ and call_unknown_or_scan is_scan cfg pdesc tenv pre path
let actuals_by_ref =
IList.filter
(function
| Sil.Lvar _, _ -> true
| Sil.Lvar _, Sil.Tptr (Sil.Tptr _, _) -> true
| _ -> false)
actual_pars in
let pre_final =

@ -35,6 +35,7 @@ extern struct delicious *bakery(struct delicious **cake);
extern struct delicious *bakery2(struct delicious **cake,
struct delicious **pie);
extern struct delicious *returnPassByRef();
extern void skip(struct delicious * s);
struct delicious *skip_external_function(void) {
struct delicious *cake = NULL;
@ -87,3 +88,10 @@ void returnPassByRefDeref() {
ret->yum = 2; // should not report a warning
free(ret);
}
int passStructByRefDeref() {
struct delicious d;
d.yum = 7;
skip(&d);
return 1 / d.yum; // should not report a warning
}

Loading…
Cancel
Save