File tree 1 file changed +7
-6
lines changed
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,15 @@ Section Riscv.
53
53
{ mach with pc := mach.(nextPc); nextPc ::= word.add (word.of_Z 4) }.
54
54
55
55
Definition getReg(regs: Registers)(reg: Z): word :=
56
- if Z.eq_dec reg 0 then word.of_Z 0
57
- else match map.get regs reg with
58
- | Some x => x
59
- | None => word.of_Z 0
60
- end .
56
+ if ((0 <? reg) && (reg <? 32))%bool then
57
+ match map.get regs reg with
58
+ | Some x => x
59
+ | None => word.of_Z 0
60
+ end
61
+ else word.of_Z 0.
61
62
62
63
Definition setReg(reg: Z)(v: word)(regs: Registers): Registers :=
63
- if Z.eq_dec reg Register0 then regs else map.put regs reg v.
64
+ if ((0 <? reg) && (reg <? 32))%bool then map.put regs reg v else regs .
64
65
65
66
Definition run_primitive(a: riscv_primitive)(mach: State):
66
67
(primitive_result a -> State -> Prop ) -> (State -> Prop ) -> Prop :=
You can’t perform that action at this time.
0 commit comments