summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-09-19 11:10:14 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-01 00:44:53 +0200
commitd54f252497a0278ad709a97fb63bd745e132cc89 (patch)
tree23a8ab1fce22b9de709790585087e86f4cb5830d
parent71ddf37a17ea1fd6b8f7044a1fe32ce4e8559ef3 (diff)
downloadsparse-d54f252497a0278ad709a97fb63bd745e132cc89.tar.gz
flex-array: detect structures with a flexible array member
This is a preparatory step for doing the checks and warnings. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--symbol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/symbol.c b/symbol.c
index 9acffeea..6633e89d 100644
--- a/symbol.c
+++ b/symbol.c
@@ -87,6 +87,7 @@ struct struct_union_info {
unsigned long max_align;
unsigned long bit_size;
int align_size;
+ struct symbol *flex_array;
};
/*
@@ -128,6 +129,7 @@ static void lay_out_struct(struct symbol *sym, struct struct_union_info *info)
if (!is_array_type(sym))
return;
base_size = 0;
+ info->flex_array = sym;
}
align_bit_mask = bytes_to_bits(sym->ctype.alignment) - 1;