diff options
| author | Thomas Bauereiss | 2019-03-07 13:28:04 +0000 |
|---|---|---|
| committer | Thomas Bauereiss | 2019-03-07 15:15:14 +0000 |
| commit | e9d0335845cf2caffd4b4626bdedb02732fd8141 (patch) | |
| tree | 6f2263a725b453eb355d0c73b9e0645161d3cfc4 | |
| parent | a98c6844fe7ab3dc0c39a27930e6635c5cde89a1 (diff) | |
Fix bug in a mono rewrite helper function
| -rw-r--r-- | lib/mono_rewrites.sail | 4 | ||||
| -rw-r--r-- | src/monomorphise.ml | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/mono_rewrites.sail b/lib/mono_rewrites.sail index 90d74149..9e4010a0 100644 --- a/lib/mono_rewrites.sail +++ b/lib/mono_rewrites.sail @@ -119,9 +119,9 @@ function place_slice(m,xs,i,l,shift) = { } val set_slice_zeros : forall 'n, 'n >= 0. - (atom('n), int, bits('n), int) -> bits('n) effect pure + (atom('n), bits('n), int, int) -> bits('n) effect pure -function set_slice_zeros(n, i, xs, l) = { +function set_slice_zeros(n, xs, i, l) = { let ys : bits('n) = slice_mask(n, i, l) in xs & ~(ys) } diff --git a/src/monomorphise.ml b/src/monomorphise.ml index 07063ac4..fdc20932 100644 --- a/src/monomorphise.ml +++ b/src/monomorphise.ml @@ -2961,9 +2961,9 @@ let rec rewrite_app env typ (id,args) = else if is_id env (Id "__SetSlice_bits") id then match args with - | [len; slice_len; vector; pos; E_aux (E_app (zeros, _), _)] + | [len; slice_len; vector; start; E_aux (E_app (zeros, _), _)] when is_zeros zeros -> - E_app (mk_id "set_slice_zeros", [len; slice_len; vector; pos]) + E_app (mk_id "set_slice_zeros", [len; vector; start; slice_len]) | _ -> E_app (id, args) else E_app (id,args) |
