Skip to content

Commit 26b6c9a

Browse files
filipeomredianthus
authored andcommitted
Prepare for smtml.0.25.0
Use the new bitvector API that requires passing bit offsets instead of the previous non-standard byte offsets.
1 parent 8357ccd commit 26b6c9a

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

dune-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
(sedlex
7676
(>= 3.3))
7777
(smtml
78-
(>= 0.22.0))
78+
(>= 0.25.0))
7979
(symex
8080
(>= 0.2))
8181
(synchronizer

owi.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ depends: [
3939
"prelude" {>= "0.5"}
4040
"processor" {>= "0.2"}
4141
"sedlex" {>= "3.3"}
42-
"smtml" {>= "0.22.0"}
42+
"smtml" {>= "0.25.0"}
4343
"symex" {>= "0.2"}
4444
"synchronizer" {>= "0.3"}
4545
"uutf" {>= "1.0.3"}

shell.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ let
2222
};
2323
meta.broken = false;
2424
});
25+
smtml = super.smtml.overrideAttrs (old: {
26+
src = pkgs.fetchFromGitHub {
27+
owner = "formalsec";
28+
repo = "smtml";
29+
rev = "3d19685d6859df7695eb697571b2a8ec41638068";
30+
hash = "sha256-dWZrN0hTxxqGC2queit91GDuw/x5fyRPwHbmKxkvc/w=";
31+
};
32+
});
2533
});
2634
tinygo = pkgs.tinygo.overrideAttrs (old: {
2735
doCheck = false;
@@ -45,6 +53,7 @@ pkgs.mkShell {
4553
merlin
4654
ocaml
4755
ocamlformat
56+
ocaml-lsp
4857
ocp-browser
4958
ocp-index
5059
ocb

src/symbolic/symbolic_memory.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@ let store_8 m ~addr v =
173173
let open Symbolic_choice in
174174
let* a = must_be_valid_address m addr 1 in
175175
let data =
176-
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:1 ~low:0) m.data
176+
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:7 ~low:0) m.data
177177
in
178178
replace { m with data }
179179

180180
let store_16 m ~addr v =
181181
let open Symbolic_choice in
182182
let* a = must_be_valid_address m addr 2 in
183183
let data =
184-
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:1 ~low:0) m.data
184+
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:7 ~low:0) m.data
185185
|> replace_byte (Int32.add a 1l)
186-
(Smtml.Typed.Bitv32.extract v ~high:2 ~low:1)
186+
(Smtml.Typed.Bitv32.extract v ~high:15 ~low:8)
187187
in
188188
replace { m with data }
189189

@@ -213,7 +213,7 @@ let store_64 m ~(addr : Symbolic_i32.t) v =
213213
let store_8_no_replace m data ~(addr : Symbolic_i32.t) v =
214214
let open Symbolic_choice in
215215
let+ a = must_be_valid_address m addr 1 in
216-
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:1 ~low:0) data
216+
replace_byte a (Smtml.Typed.Bitv32.extract v ~high:7 ~low:0) data
217217

218218
let fill m ~(pos : Symbolic_i32.t) ~(len : Symbolic_i32.t) (c : char) =
219219
let open Symbolic_choice in

0 commit comments

Comments
 (0)