[PATCH 03/13] flex-array: do not lay out invalid struct members

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Do not bother trying to lay out invalid struct members,
ignore them as it will avoid to special case them later.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 symbol.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/symbol.c b/symbol.c
index 365351a0a756..4c93a0fb4880 100644
--- a/symbol.c
+++ b/symbol.c
@@ -121,10 +121,12 @@ static void lay_out_struct(struct symbol *sym, struct struct_union_info *info)
 	base_size = sym->bit_size; 
 
 	/*
-	 * Unsized arrays cause us to not align the resulting
-	 * structure size
+	 * If the member is unsized, either it's a flexible array or
+	 * it's invalid and a warning has already been issued.
 	 */
 	if (base_size < 0) {
+		if (!is_array_type(sym))
+			return;
 		info->align_size = 0;
 		base_size = 0;
 	}
-- 
2.28.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux