]> andersk Git - splint.git/blobdiff - src/uentryList.c
Fixed problem with unnamed unions within struct definitions.
[splint.git] / src / uentryList.c
index ae3a8a67508afeb2afb8b7fdec6b9b226192b475..96951d631248e8aa46ae8088da90ead99abddf52 100644 (file)
@@ -702,6 +702,26 @@ uentryList_lookupField (uentryList f, cstring name)
     }
   else
     {
+      uentryList_elements (f, el)
+       {
+         if (uentry_isUnnamedVariable (el))
+           {
+             ctype ct = uentry_getType (el);
+
+             if (ctype_isStruct (ct) || ctype_isUnion (ct))
+               {
+                 uentryList fields = ctype_getFields (ct);
+                 uentry ue = uentryList_lookupField (fields, name);
+
+                 if (uentry_isValid (ue))
+                   {
+                     return ue;
+                   }
+               }
+           }
+       }
+      end_uentryList_elements ;
+
       return uentry_undefined;
     }
 }
@@ -709,6 +729,8 @@ uentryList_lookupField (uentryList f, cstring name)
 /*@only@*/ uentryList
   uentryList_mergeFields (/*@only@*/ uentryList f1, /*@only@*/ uentryList f2)
 {
+  DPRINTF (("Merge: %s + %s", uentryList_unparse (f1), uentryList_unparse (f2)));
+
   if (uentryList_isUndefined (f1))
     {
       return  (f2);
This page took 0.037215 seconds and 4 git commands to generate.