Skip to content

Commit

Permalink
Fix register init
Browse files Browse the repository at this point in the history
  • Loading branch information
JuneRousseau committed Aug 10, 2023
1 parent 6362604 commit 06b5b10
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/machine.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ let init_reg_state (addr_max : Z.t) : reg_state =
let max_stk_addr = addr_max in

let l =
let seal_reg = (if !flags.sealing then 1 else 0) in
let n =
32
- (if !flags.sealing then 1 else 0)
- (if !flags.stack then 1 else 0)
32 - seal_reg
in
List.init n (fun i -> Reg (i+1), I Z.zero)
List.init n (fun i -> Reg (i+seal_reg), I Z.zero)
in

(* The PC register starts with full permission over the entire "heap" segment *)
Expand Down

0 comments on commit 06b5b10

Please sign in to comment.