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
8 changes: 4 additions & 4 deletions src/check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ and checkExp (isconst: bool) (e: exp) : typ =
| AddrOfLabel (gref) -> begin
(* Find a label *)
let lab =
match List.filter (function Label _ -> true | _ -> false)
match List.find_opt (function Label _ -> true | _ -> false)
!gref.labels with
Label (lab, _, _) :: _ -> lab
Some (Label (lab, _, _)) -> lab
| _ ->
ignore (warn "Address of label to block without a label");
"<missing label>"
Expand Down Expand Up @@ -748,9 +748,9 @@ and checkStmt (s: stmt) =
currentLoc := l;
(* Find a label *)
let lab =
match List.filter (function Label _ -> true | _ -> false)
match List.find_opt (function Label _ -> true | _ -> false)
!gref.labels with
Label (lab, _, _) :: _ -> lab
Some (Label (lab, _, _)) -> lab
| _ ->
ignore (warn "Goto to block without a label");
"<missing label>"
Expand Down
7 changes: 3 additions & 4 deletions src/frontc/cabs2cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5637,10 +5637,9 @@ and doInit
(* We have a designator *)
| _, (what, ie) :: restil when what != A.NEXT_INIT ->
let rec unrollDesignatorForNestedAnonymous (comp: compinfo) (designator: string) (whatnext: initwhat) =
let own_field = List.filter (fun fld -> fld.fname = designator) comp.cfields in
match own_field with
| fld :: _ -> (true, Some(A.INFIELD_INIT (designator, whatnext)))
| [] ->
if List.exists (fun fld -> fld.fname = designator) comp.cfields then
(true, Some(A.INFIELD_INIT (designator, whatnext)))
else
let anonymous_compounds = List.filter_map (fun f ->
(* f.ftype need not be unrolled here, inner anonymous struct cannot be typdef'ed *)
match f.ftype with
Expand Down
Loading