summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Norton2017-04-19 14:34:11 +0100
committerRobert Norton2017-04-20 11:06:05 +0100
commitdb18d9b1865505306f6f776abe8a6b90868d243b (patch)
tree92284350427d4ed39cc2d0c4d04962086f94733e
parentd1cac4d89465cfcba18c173af3f3c57a1f08f5d0 (diff)
return zero for uninitialised memory in ocaml shallow embedding model. Necessary to pass test_cp2_tagmem test. TODO make this configurable.
-rw-r--r--mips/mips_extras_ml.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/mips/mips_extras_ml.ml b/mips/mips_extras_ml.ml
index 760ef5ed..458a2f8d 100644
--- a/mips/mips_extras_ml.ml
+++ b/mips/mips_extras_ml.ml
@@ -62,7 +62,7 @@ let _MEMr (addr, size) = begin
let byte = Mem.find byte_addr !mips_mem in
to_vec_dec_int (8, byte)
with Not_found ->
- to_vec_dec_undef_int 8 in
+ to_vec_dec_int (8, 0) in (* XXX return 0 for uninitialised memory. Optionally return undef instead. *)
ret := vector_concat byte_vec (!ret);
(*printf "MEM [%s] -> %x %s %s\n" (big_int_to_hex byte_addr) byte (string_of_value byte_vec) (string_of_value !ret);*)
done;