From 453baf68e02f985a7400207d133fff7b47440f22 Mon Sep 17 00:00:00 2001
From: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Mon, 21 Mar 2016 13:55:25 -0400
Subject: [PATCH] fix bug in IL checking

---
 lisc/tools/abi.ml | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisc/tools/abi.ml b/lisc/tools/abi.ml
index 7810e41..2257aa2 100644
--- a/lisc/tools/abi.ml
+++ b/lisc/tools/abi.ml
@@ -379,8 +379,12 @@ module OutIL = struct
       siter oc name (s, ts)
       begin fun id' addr (TB (b, tb)) ->
         let tval = tmp () in
-        fprintf oc "\t%s =%s load %s\n"
-          tval (btype b) addr;
+        let lsuffix =
+          if AB b = AB Char  then "sb" else
+          if AB b = AB Short then "sh" else
+          "" in
+        fprintf oc "\t%s =%s load%s %s\n"
+          tval (btype b) lsuffix addr;
         bcheck (100*id + id'+1) tval (b, tb);
       end;
       ()