Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JuneRousseau committed Jun 6, 2024
1 parent 96e6e2f commit 7a84d72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions lib/machine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,7 @@ let load_deep_immutable (w : word) : word =
| _ -> w

let authorised_access_system_register (conf : exec_conf) : bool =
match PC @! conf with
| Sealable (Cap (p, _, _, _, _)) -> PermSet.mem SR p
| _ -> false
match PC @! conf with Sealable (Cap (p, _, _, _, _)) -> PermSet.mem SR p | _ -> false

(* NOTE Although we've already check that not supported instructions / capabilities *)
(* are not in the initial machine, we still need to make sure that *)
Expand Down Expand Up @@ -275,8 +273,9 @@ let exec_single (conf : exec_conf) : mchn =
(Running, upd_reg PC new_pc conf)
| _, _ -> fail_state))
| MoveSR (r, c) ->
if authorised_access_system_register conf
then let w = get_word conf c in !>(upd_reg r w conf)
if authorised_access_system_register conf then
let w = get_word conf c in
!>(upd_reg r w conf)
else fail_state
| Move (r, c) when (not (r = mtdc)) && not (c = Register mtdc) ->
let w = get_word conf c in
Expand Down
8 changes: 4 additions & 4 deletions lib/pretty_printer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ let string_of_regname (r : regname) : string =
match r with
| PC -> "pc"
| Reg i ->
if r = stk then "stk"
else if r = cgp then "cgp"
else if r = mtdc then "mtdc"
else "r" ^ string_of_int i
if r = stk then "stk"
else if r = cgp then "cgp"
else if r = mtdc then "mtdc"
else "r" ^ string_of_int i

let string_of_seal_perm (p : seal_perm) : string =
match p with false, false -> "SO" | true, false -> "S" | false, true -> "U" | true, true -> "SU"
Expand Down

0 comments on commit 7a84d72

Please sign in to comment.