summary refs log tree commit diff
path: root/lo2.ml
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-04-05 15:23:24 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:26 -0400
commit20df24da7568c67741dfbcf2560bfea516154ae1 (patch)
treeb22285d261482bacb55b86c3e283fb80fb27aa17 /lo2.ml
parent0aa0002337ca3a101752f19e9cc1a153afb846af (diff)
downloadroux-20df24da7568c67741dfbcf2560bfea516154ae1.tar.gz
cleanup overflow computation
Diffstat (limited to 'lo2.ml')
-rw-r--r--lo2.ml5
1 files changed, 3 insertions, 2 deletions
diff --git a/lo2.ml b/lo2.ml
index 32342b8..bc2624b 100644
--- a/lo2.ml
+++ b/lo2.ml
@@ -467,8 +467,9 @@ let codegen (p: mprog): string =
     outb rex; outb op; outb (modrm r m) in
 
   let slot s =
-    assert (s*8<256);
-    ((-1-s) * 8) land 0xff in
+    let c = ((-1-s) * 8) land 0xff in
+    assert (c < 256);
+    c in
 
   let move l l1 = match l, l1 with
     | (LReg _ as r), LCon k ->