Skip to content

Commit

Permalink
simplify implementation of owi_char
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Jul 31, 2024
1 parent 327c907 commit 55bc3fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
13 changes: 1 addition & 12 deletions src/concolic/concolic_wasm_ffi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,7 @@ module M :
in
(I32 n, Value.pair n sym_expr) )

let symbol_char () : Value.int32 Choice.t =
Choice.with_new_symbol (Ty_bitv 32) (fun sym forced_value ->
let n =
match forced_value with
| None -> Int32.logand 0xFFl (Random.bits32 ())
| Some (Num (I32 n)) -> n
| _ -> assert false
in
let sym_expr =
Expr.make (Cvtop (Ty_bitv 32, Zero_extend 24, Expr.mk_symbol sym))
in
(I32 n, Value.pair n sym_expr) )
let symbol_char = symbol_i8

let symbol_i64 () : Value.int64 Choice.t =
Choice.with_new_symbol (Ty_bitv 64) (fun sym forced_value ->
Expand Down
4 changes: 1 addition & 3 deletions src/symbolic/symbolic_wasm_ffi.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ module M :
Choice.with_new_symbol (Ty_bitv 8) (fun sym ->
Expr.make (Cvtop (Ty_bitv 32, Zero_extend 24, Expr.symbol sym)) )

let symbol_char () =
Choice.with_new_symbol (Ty_bitv 8) (fun sym ->
Expr.make (Cvtop (Ty_bitv 32, Zero_extend 24, Expr.symbol sym)) )
let symbol_char = symbol_i8

let symbol_i32 () = Choice.with_new_symbol (Ty_bitv 32) Expr.symbol

Expand Down

0 comments on commit 55bc3fa

Please sign in to comment.