From 4f33892c81cdaf6aefaad9b7cef1456dcfead67c Mon Sep 17 00:00:00 2001 From: Son Ho Date: Thu, 30 Jun 2022 06:46:52 +0200 Subject: Take failing rvalues into account in FunsAnalysis.analyze_fun_decls --- src/ExpressionsUtils.ml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/ExpressionsUtils.ml (limited to 'src/ExpressionsUtils.ml') diff --git a/src/ExpressionsUtils.ml b/src/ExpressionsUtils.ml new file mode 100644 index 00000000..c3ccfb15 --- /dev/null +++ b/src/ExpressionsUtils.ml @@ -0,0 +1,10 @@ +module E = Expressions + +let unop_can_fail (unop : E.unop) : bool = + match unop with Neg | Cast _ -> true | Not -> false + +let binop_can_fail (binop : E.binop) : bool = + match binop with + | BitXor | BitAnd | BitOr | Eq | Lt | Le | Ne | Ge | Gt -> false + | Div | Rem | Add | Sub | Mul -> true + | Shl | Shr -> raise Errors.Unimplemented -- cgit v1.2.3