We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8ac672 commit 5550d17Copy full SHA for 5550d17
1 file changed
src/frontc/cabs2cil.ml
@@ -5637,10 +5637,9 @@ and doInit
5637
(* We have a designator *)
5638
| _, (what, ie) :: restil when what != A.NEXT_INIT ->
5639
let rec unrollDesignatorForNestedAnonymous (comp: compinfo) (designator: string) (whatnext: initwhat) =
5640
- let own_field = List.find_opt (fun fld -> fld.fname = designator) comp.cfields in
5641
- match own_field with
5642
- | Some _ -> (true, Some(A.INFIELD_INIT (designator, whatnext)))
5643
- | None ->
+ if List.exists (fun fld -> fld.fname = designator) comp.cfields then
+ (true, Some(A.INFIELD_INIT (designator, whatnext)))
+ else
5644
let anonymous_compounds = List.filter_map (fun f ->
5645
(* f.ftype need not be unrolled here, inner anonymous struct cannot be typdef'ed *)
5646
match f.ftype with
0 commit comments