summary refs log tree commit diff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-22 12:23:53 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2016-03-22 12:23:53 -0400
commit59e78fe9694fc7cd6ce64a3e10bef57a6eb05b11 (patch)
tree1e879a7778fcf2f8beb1102e9d266afe20fd22ac
parenta67ffa423cc859ac5093337e26af9c87af4631f6 (diff)
downloadroux-59e78fe9694fc7cd6ce64a3e10bef57a6eb05b11.tar.gz
fix incorrect size suffix in abi fuzzer
-rw-r--r--lisc/tools/abi.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
index 301e160..88a59de 100644
--- a/lisc/tools/abi.ml
+++ b/lisc/tools/abi.ml
@@ -342,6 +342,11 @@ module OutIL = struct
      | Empty, () -> () in
    f 0 0 s
 
+  let bmemtype b =
+    if AB b = AB Char  then "b" else
+    if AB b = AB Short then "h" else
+    btype b
+
   let init oc = function
     | TA (Base b, tb) -> bvalue (b, tb)
     | TA (Struct s, ts) ->
@@ -351,7 +356,7 @@ module OutIL = struct
       siter oc base (s, ts)
       begin fun _ addr (TB (b, tb)) ->
         fprintf oc "\tstore%s %s, %s\n"
-          (btype b) (bvalue (b, tb)) addr;
+          (bmemtype b) (bvalue (b, tb)) addr;
       end;
       base
 
@@ -396,11 +401,7 @@ module OutIL = struct
   let typedef oc name =
     let rec f: type a. a sty -> unit = function
       | Field (b, s) ->
-        fprintf oc "%s" begin
-          if AB b = AB Char  then "b" else
-          if AB b = AB Short then "h" else
-          btype b
-        end;
+        fprintf oc "%s" (bmemtype b);
         if not (styempty s) then
           fprintf oc ", ";
         f s;