summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKathy Gray2017-01-27 16:19:25 +0000
committerKathy Gray2017-01-27 16:19:25 +0000
commit6cf8646600405780d67ad2bf152c8ae70589d9b8 (patch)
treebd3bbc10c1805704cab99c210049ab4fd76e7b4f /src
parent78abbc3af0f92f1a579542b84d2e33d07fc58b99 (diff)
fix right shift
Diffstat (limited to 'src')
-rw-r--r--src/lem_interp/interp_lib.lem16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lem_interp/interp_lib.lem b/src/lem_interp/interp_lib.lem
index 625dfb6c..47b3c833 100644
--- a/src/lem_interp/interp_lib.lem
+++ b/src/lem_interp/interp_lib.lem
@@ -701,15 +701,15 @@ let rec shift_op_vec op v =
let fail () = Assert_extra.failwith ("shift_op_vec given unexpected " ^ (string_of_value v)) in
let arith_op_help vl vr =
match (vl,vr) with
- | (V_vector b ord cs,V_lit (L_aux (L_num n) _)) ->
- let n = natFromInteger n in
- (match op with
- | "<<" ->
- V_vector b ord
- ((from_n_to_n n ((length cs) - 1) cs) ++(List.replicate n (V_lit (L_aux L_zero Unknown))))
- | ">>" ->
+ | (V_vector b ord cs,V_lit (L_aux (L_num n) _)) ->
+ let n = natFromInteger n in
+ (match op with
+ | "<<" ->
+ V_vector b ord
+ ((from_n_to_n n ((length cs) - 1) cs) ++(List.replicate n (V_lit (L_aux L_zero Unknown))))
+ | ">>" ->
V_vector b ord
- ((List.replicate n (V_lit (L_aux L_zero Unknown))) ++ (from_n_to_n 0 (n-1) cs))
+ ((List.replicate n (V_lit (L_aux L_zero Unknown))) ++ (from_n_to_n 0 (((length cs) -1) - n) cs))
| "<<<" ->
V_vector b ord
((from_n_to_n n ((length cs) -1) cs) ++ (from_n_to_n 0 (n-1) cs))