Skip to content

Commit bc1faef

Browse files
committed
fix dummy symbol creation
1 parent cefda28 commit bc1faef

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

shell.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ let
88
src = pkgs.fetchFromGitHub {
99
owner = "redianthus";
1010
repo = "smtml";
11-
rev = "b8853d3a589722652904dfc1d6f85958f954dd4c";
12-
hash = "sha256-9ogUDfsUbHsEfMhxdfA/bvUVLy4oxBT7pXnGQkPiLkY=";
11+
rev = "25a307e685b79ef772266a76070922dfdb25bd80";
12+
hash = "sha256-BgsX69fTCPc3ScTmiDpeScem+k6CJ+61RIdoSVp2At4=";
1313
};
1414
});
1515
synchronizer = pkgs.ocamlPackages.synchronizer.overrideAttrs (old: {

src/symbolic/symbol_scope.ml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,16 @@ let get_value model sym ty =
4040
| Some v -> v
4141
| None -> (
4242
(* The symbol was created but is not part of the generated model. Thus we can use a dummy value. TODO: allows to hide these symbols or their value through a flag (and make it the default, the flag should actually display them). *)
43+
(* TODO: do this in Smt.ml, see https://github.com/formalsec/smtml/issues/483 *)
4344
let res =
4445
match ty with
4546
| Smtml.Ty.Ty_bool -> Smtml.Value.of_string ty "false"
46-
| Ty_bitv 8 ->
47-
Ok (Smtml.Value.Bitv (Smtml.Bitvector.make (Z.of_string "0") 8))
48-
| Ty_bitv 32 ->
49-
Ok (Smtml.Value.Bitv (Smtml.Bitvector.make (Z.of_string "0") 32))
50-
| Ty_bitv 64 ->
51-
Ok (Smtml.Value.Bitv (Smtml.Bitvector.make (Z.of_string "0") 64))
47+
| Ty_bitv n ->
48+
Ok (Smtml.Value.Bitv (Smtml.Bitvector.make (Z.of_string "0") n))
5249
| Ty_fp 32 -> Smtml.Value.of_string ty "0.0"
5350
| Ty_fp 64 -> Smtml.Value.of_string ty "0.0"
54-
| ty ->
55-
Log.err (fun m ->
56-
m "unhandled type %a in symbol_scope.ml" Smtml.Ty.pp ty );
51+
| _ty ->
52+
(* if this fails, it may be that we changed something and a new type should be added here *)
5753
assert false
5854
in
5955
match res with Ok v -> v | Error _ -> assert false )

0 commit comments

Comments
 (0)