diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-04-05 15:23:24 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:26 -0400 |
commit | 20df24da7568c67741dfbcf2560bfea516154ae1 (patch) | |
tree | b22285d261482bacb55b86c3e283fb80fb27aa17 /lo2.ml | |
parent | 0aa0002337ca3a101752f19e9cc1a153afb846af (diff) | |
download | roux-20df24da7568c67741dfbcf2560bfea516154ae1.tar.gz |
cleanup overflow computation
Diffstat (limited to 'lo2.ml')
-rw-r--r-- | lo2.ml | 5 |
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 -> |