Skip to content

Commit

Permalink
commiting to test in goblint
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tietz committed Feb 1, 2024
1 parent c81580c commit 24d806c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ and stmtkind =
GCC), (2) templates (CR-separated), (3) a list of
outputs, each of which is an lvalue with a constraint, (4) a list
of input expressions along with constraints, (5) clobbered
registers, (5) location information, and (6) the labels list for asm goto *)
registers, (6) the labels list for asm goto, and (7) location information *)


(** Instructions. They may cause effects directly but may not have control
Expand Down
8 changes: 5 additions & 3 deletions src/frontc/cparser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,19 @@ let transformOffsetOf (speclist, dtype) member =

(* this makes sure that the labels are only allowed when goto annotation was provided *)
let checkAsm asm =
let labels_no_goto = "labels provided in inline asm without goto attribute" in
let goto_no_labels = "expected non-empty labels list in asm goto" in
(match asm with
| ASM (attrs, _, details, _) ->
(match details, (List.assoc_opt "goto" attrs) with
| None, Some _ ->
parse_error "expected non-empty labels list in asm goto";
parse_error goto_no_labels;
raise Parsing.Parse_error
| Some details, Some _ when details.alabels = [] ->
parse_error "expected non-empty labels list in asm goto";
parse_error goto_no_labels;
raise Parsing.Parse_error
| Some details, None when details.alabels <> [] ->
parse_error "labels provided in inline asm without goto attribute";
parse_error labels_no_goto;
raise Parsing.Parse_error
| _, _ -> ())
| _ -> failwith "called checkAsm on non-ASM variant");
Expand Down

0 comments on commit 24d806c

Please sign in to comment.