diff options
| author | Brian Campbell | 2018-04-17 17:51:49 +0100 |
|---|---|---|
| committer | Brian Campbell | 2018-04-17 17:52:47 +0100 |
| commit | fc68bc64caa3df3e3da2456e43cfda2e7727a42c (patch) | |
| tree | abc1ee10b112bbe497791d34e7302bc0917791c6 /src | |
| parent | b62803b6a9af95aa2e0a4e7a6388db066d897b5b (diff) | |
Fix slicing in constant propagation
Diffstat (limited to 'src')
| -rw-r--r-- | src/monomorphise.ml | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/monomorphise.ml b/src/monomorphise.ml index 78ccee24..f417d292 100644 --- a/src/monomorphise.ml +++ b/src/monomorphise.ml @@ -779,14 +779,14 @@ let bits_of_lit = function let slice_lit (L_aux (lit,ll)) i len (Ord_aux (ord,_)) = let i = Big_int.to_int i in let len = Big_int.to_int len in + let bin = bits_of_lit lit in match match ord with | Ord_inc -> Some i - | Ord_dec -> Some (len - i) + | Ord_dec -> Some (String.length bin - i - len) | Ord_var _ -> None with | None -> None | Some i -> - let bin = bits_of_lit lit in Some (L_aux (L_bin (String.sub bin i len),Generated ll)) let concat_vec lit1 lit2 = |
