From e75879992c5a5a5102a4c5f20b90e6a1032b8ec5 Mon Sep 17 00:00:00 2001 From: Aymeric Fromherz Date: Fri, 22 Sep 2023 16:40:31 +0200 Subject: Add support for Shl/Shr typechecking in InterpreterExpressions --- compiler/InterpreterExpressions.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/InterpreterExpressions.ml') diff --git a/compiler/InterpreterExpressions.ml b/compiler/InterpreterExpressions.ml index 8b2070c6..469bebec 100644 --- a/compiler/InterpreterExpressions.ml +++ b/compiler/InterpreterExpressions.ml @@ -523,7 +523,10 @@ let eval_binary_op_symbolic (config : C.config) (binop : E.binop) | E.BitOr -> assert (int_ty1 = int_ty2); T.Literal (Integer int_ty1) - | E.Shl | E.Shr -> raise Unimplemented + | E.Shl | E.Shr -> + (* The number of bits can be of a different integer type + than the operand *) + T.Literal (Integer int_ty1) | E.Ne | E.Eq -> raise (Failure "Unreachable")) | _ -> raise (Failure "Invalid inputs for binop") in -- cgit v1.2.3