summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlasdair Armstrong2017-09-18 19:01:16 +0100
committerAlasdair Armstrong2017-09-18 19:01:16 +0100
commite4a2b9205daa7dd8a3a05b3a972d00c23f2adc7a (patch)
treec1572dd913cf2548b54534c6036050f9dd183b23 /lib
parentbf509b250cf676e96e11ace54648f30e43848754 (diff)
Added additional utility functions in ast_util
Also fixed basic ocaml test suite
Diffstat (limited to 'lib')
-rw-r--r--lib/ocaml_rts/elf_loader.ml13
-rw-r--r--lib/ocaml_rts/sail_lib.ml2
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/ocaml_rts/elf_loader.ml b/lib/ocaml_rts/elf_loader.ml
index 4e35a192..ab49c57b 100644
--- a/lib/ocaml_rts/elf_loader.ml
+++ b/lib/ocaml_rts/elf_loader.ml
@@ -122,11 +122,8 @@ let load_segment seg =
List.iteri (fun i byte -> Sail_lib.wram (add_big_int paddr (big_int_of_int i)) byte) (List.map int_of_char bs)
let load_elf () =
- let name =
- match !opt_file_arguments with
- | (name :: _) -> name
- | [] -> failwith "Must provide an elf file"
- in
- let segments, e_entry = read name in
- List.iter load_segment segments;
- ()
+ match !opt_file_arguments with
+ | (name :: _) ->
+ let segments, e_entry = read name in
+ List.iter load_segment segments
+ | [] -> ()
diff --git a/lib/ocaml_rts/sail_lib.ml b/lib/ocaml_rts/sail_lib.ml
index 0602a3d0..6c0a0f64 100644
--- a/lib/ocaml_rts/sail_lib.ml
+++ b/lib/ocaml_rts/sail_lib.ml
@@ -315,3 +315,5 @@ let shl_int (n, m) = shift_left_big_int n (int_of_big_int m)
let shr_int (n, m) = shift_right_big_int n (int_of_big_int m)
let debug (str1, n, str2, v) = prerr_endline (str1 ^ string_of_big_int n ^ str2 ^ string_of_bits v)
+
+let eq_string (str1, str2) = String.compare str1 str2 == 0