Skip to contentSkip to conversation

saner reporting of overlaps in initializers

PATCH New Al Viro 1 participant 1 message May 25, 2007 Sparse checker

lore
Share & tools
lore

Al Viro

author
#0 lore raw

PATCH 1/1 saner reporting of overlaps in initializers

Fix the check for overlapping initializers; the current code tries to skip ones with zero ->bit_size, but doesn't get it right.

---
 expand.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
expand.c +3 -1
index aafbfe0..a46f1c2 100644
@@ -874,7 +874,9 @@ static void verify_nonoverlapping(struct expression_list **list)
 	struct expression *b;
 
 	FOR_EACH_PTR(*list, b) {
-		if (a && a->ctype && a->ctype->bit_size && bit_offset(a) == bit_offset(b)) {
+		if (!b->ctype || !b->ctype->bit_size)
+			continue;
+		if (a && bit_offset(a) == bit_offset(b)) {
 			sparse_error(a->pos, "Initializer entry defined twice");
 			info(b->pos, "  also defined here");
 			return;
Signature · 1 line
1.5.0-rc2.GIT