From e9d0335845cf2caffd4b4626bdedb02732fd8141 Mon Sep 17 00:00:00 2001 From: Thomas Bauereiss Date: Thu, 7 Mar 2019 13:28:04 +0000 Subject: Fix bug in a mono rewrite helper function --- lib/mono_rewrites.sail | 4 ++-- 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) -- cgit v1.2.3