diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2006-09-17 08:58:31 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2006-09-17 08:58:31 +0000 |
commit | ca0e5f4fe9b4063991fa5e9eafe6a48f933b7c45 (patch) | |
tree | 922a9f15110c392af61ef1fb3d8183d2f871f073 /caml | |
parent | 53b57751c1981e0bce3aa470e426a12034bb165e (diff) | |
download | compcert-ca0e5f4fe9b4063991fa5e9eafe6a48f933b7c45.tar.gz compcert-ca0e5f4fe9b4063991fa5e9eafe6a48f933b7c45.zip |
Meilleur message de debug dans le cas Icall
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@102 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'caml')
-rw-r--r-- | caml/RTLtypingaux.ml | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/caml/RTLtypingaux.ml b/caml/RTLtypingaux.ml index b76a0bb8..64f839a2 100644 --- a/caml/RTLtypingaux.ml +++ b/caml/RTLtypingaux.ml @@ -46,12 +46,21 @@ let type_instr retty (Coq_pair(pc, i)) = set_types args (type_of_addressing addr); set_type src (type_of_chunk chunk) | Icall(sg, ros, args, res, _) -> - begin match ros with - | Coq_inl r -> set_type r Tint - | Coq_inr _ -> () - end; - set_types args sg.sig_args; - set_type res (match sg.sig_res with None -> Tint | Some ty -> ty) + begin try + begin match ros with + | Coq_inl r -> set_type r Tint + | Coq_inr _ -> () + end; + set_types args sg.sig_args; + set_type res (match sg.sig_res with None -> Tint | Some ty -> ty) + with Type_error msg -> + let name = + match ros with + | Coq_inl _ -> "<reg>" + | Coq_inr id -> extern_atom id in + raise(Type_error (Printf.sprintf "type mismatch in Icall(%s): %s" + name msg)) + end | Ialloc(arg, res, _) -> set_type arg Tint; set_type res Tint | Icond(cond, args, _, _) -> |