summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Campbell2018-04-02 17:06:34 +0100
committerBrian Campbell2018-04-04 14:45:00 +0100
commit28f2c31d146afb7d4cece08a411317eb05a1f963 (patch)
tree2eda504093263929fa2fcf7b9663e691f6685197 /src
parentc36900a7b95e14f9bcfa8b2c5687fbfd0f7fa6a5 (diff)
Add bitvector casts to funcl bodies when necessary
Diffstat (limited to 'src')
-rw-r--r--src/monomorphise.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/monomorphise.ml b/src/monomorphise.ml
index 8ff5dc20..9cd55ea3 100644
--- a/src/monomorphise.ml
+++ b/src/monomorphise.ml
@@ -3807,6 +3807,10 @@ let add_bitvector_casts (Defs defs) =
in
let pat,guard,body,annot = destruct_pexp pexp in
let body = rewrite_body ret_typ body in
+ (* Also add a cast around the entire function clause body, if necessary *)
+ let body =
+ make_bitvector_cast_exp (fill_in_type (env_of body) (typ_of body)) ret_typ body
+ in
let pexp = construct_pexp (pat,guard,body,annot) in
FCL_aux (FCL_Funcl (id,pexp),fcl_ann)
in