diff options
author | Son Ho | 2022-06-30 06:46:52 +0200 |
---|---|---|
committer | Son Ho | 2022-06-30 06:46:52 +0200 |
commit | 4f33892c81cdaf6aefaad9b7cef1456dcfead67c (patch) | |
tree | 5cfe38e3cea5518179f3655d22171620287817aa /src/ExpressionsUtils.ml | |
parent | 775b2473976075aa6458a51682f3beeee75dc17a (diff) |
Take failing rvalues into account in FunsAnalysis.analyze_fun_decls
Diffstat (limited to '')
-rw-r--r-- | src/ExpressionsUtils.ml | 10 |
1 files changed, 10 insertions, 0 deletions
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 |