[frontend] Getting appropriate type information for exp in sizeof exp

Summary:
:
Previously, we did not have information about type of `exp` in `sizeof exp` from clang plugin which led to `Bad_footprint` errors. Infer did not understand `sizeof *p` in `struct Person* p = malloc(sizeof *p);` and used some default type.
This resulted in `Bad_footprint` error when trying to assign to a field `age` in `p->age=42;`.

This diff uses the version of clang plugin which exports the appropriate type information.

update-submodule: facebook-clang-plugins

Reviewed By: dulmarod

Differential Revision: D7179870

fbshipit-source-id: 4104f10
master
Daiva Naudziuniene 7 years ago committed by Facebook Github Bot
parent d2cc5e72f7
commit 5898417fdd

@ -1 +1 @@
Subproject commit 9d03cb460a30ad02d7b5edfa38f3a1143e642cfe
Subproject commit a77526452b10339b3580d58b02c9c8f534b79589

@ -129,3 +129,11 @@ void function_call_returns_allocated_pointer() {
assign(p, 42);
free(p);
}
void sizeof_expr_ok(void) {
struct Person* p = malloc(sizeof *p);
if (p) {
p->age = 42;
}
free(p);
}

Loading…
Cancel
Save