summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 22:06:41 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-18 22:30:27 -0400
commit47cebe349ca02adadb4ba6d3eb1aca0a75aa3129 (patch)
tree40c54c3152dfd4072260f7c768b30d68147fd88a
parent29ea37fa0602db27c87650b609c85c2de3e26864 (diff)
downloadroux-47cebe349ca02adadb4ba6d3eb1aca0a75aa3129.tar.gz
start work on an abi fuzzer
-rw-r--r--lisc/tools/abi.ml30
1 files changed, 30 insertions, 0 deletions
diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
new file mode 100644
index 0000000..0427454
--- /dev/null
+++ b/lisc/tools/abi.ml
@@ -0,0 +1,30 @@
+(* fuzzer *)
+
+module R = Random
+
+let maxargs = 10
+let maxmems = 16
+
+type _ basety =
+  | Char: int basety
+  | Short: int basety
+  | Int: int basety
+  | Long: int basety
+  | Float: float basety
+  | Double: float basety
+
+type _ structy =
+  | Field: 'a basety * 'b structy -> ('a * 'b) structy
+  | Empty: unit structy
+
+type _ abity =
+  | Base: 'a basety -> 'a abity
+  | Struct: 'a structy -> 'a abity
+
+let _ =
+  let f = open_in "/dev/urandom" in
+  let s = Char.code (input_char f) in
+  let s = Char.code (input_char f) + (s lsl 8) in
+  R.init s;
+  Printf.printf "Seed: %d\n" s;
+  ()