Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/uentryList.c
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ uentryList_lookupField (uentryList f, cstring name)
{
uentry old = uentryList_lookupField (f1, uentry_rawName (current));

if (uentry_isValid (old))
if (uentry_isValid (old) && uentry_rawName(current))
{
voptgenerror
(FLG_SYNTAX,
Expand Down
8 changes: 7 additions & 1 deletion test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ UNITTESTS = \
special stack staticarray strings \
stringliteral \
structassign typequals typeof ud ulstypes union unioninit \
unnamedsu unreachable unsignedcompare \
unnamedsu unnamedreused unreachable unsignedcompare \
unused ullint utypes void widestrings
UNITEXPECTS = $(addsuffix .expect, $(UNITTESTS))

Expand Down Expand Up @@ -886,6 +886,10 @@ unioninit:
unnamedsu:
-$(SPLINTR) unnamedsu.c -expect 0

.PHONY: unnamedreused
unnamedreused:
-$(SPLINTR) unnamedreused.c -expect 0

.PHONY: unreachable
unreachable:
-$(SPLINTR) unreachable.c -expect 5
Expand Down Expand Up @@ -1228,6 +1232,7 @@ EXTRA_DIST = ./abst_t.lcl \
./unreachable.c \
./unsignedcompare.c \
./unnamedsu.c \
./unnamedreused.c \
./unused.c \
./void.c \
./conditions/miroslaw.c \
Expand Down Expand Up @@ -1498,6 +1503,7 @@ EXTRA_DIST = ./abst_t.lcl \
ulstypes.expect \
union.expect \
unnamedsu.expect \
unnamedreused.expect \
unreachable.expect \
unsignedcompare.expect \
unused.expect \
Expand Down
38 changes: 38 additions & 0 deletions test/unnamedreused.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
typedef struct
{
union
{
int DWord;
struct
{
union
{
short WordL;
struct
{
unsigned char CharLL;
unsigned char CharLH;
};
};
union
{
short WordH;
struct
{
unsigned char CharHL;
unsigned char CharHH;
};
};
};
};
} su;

unsigned char f (int value)
{
su This;

This.CharHH = (unsigned char)0;
This.DWord = value;
return This.CharHH;
}

2 changes: 2 additions & 0 deletions test/unnamedreused.expect
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

Finished checking --- no warnings