Skip to content
Snippets Groups Projects
Commit 15e806d3 authored by Basile Desloges's avatar Basile Desloges
Browse files

[eacsl] Handle `TLogic_coerce` in `context_sensitive_term_to_exp`

The previous solution removed the first `TLogic_coerce` of a term in
`term_to_exp`, which would result in errors if several successive
`TLogic_coerce` were in a term. This commit recursively call
`context_sensitive_term_to_exp` on `TLogic_coerce`.
parent 369f713d
No related branches found
No related tags found
No related merge requests found
...@@ -533,7 +533,7 @@ and context_insensitive_term_to_exp kf env t = ...@@ -533,7 +533,7 @@ and context_insensitive_term_to_exp kf env t =
e e
in in
e, env, Typed_number.C_number, "" e, env, Typed_number.C_number, ""
| TLogic_coerce _ -> assert false (* handle in [term_to_exp] *) | TLogic_coerce (_, t) -> context_insensitive_term_to_exp kf env t
| TAddrOf lv -> | TAddrOf lv ->
let lv, env, _ = tlval_to_lval kf env lv in let lv, env, _ = tlval_to_lval kf env lv in
Cil.mkAddrOf ~loc lv, env, Typed_number.C_number, "addrof" Cil.mkAddrOf ~loc lv, env, Typed_number.C_number, "addrof"
...@@ -616,7 +616,6 @@ and term_to_exp kf env t = ...@@ -616,7 +616,6 @@ and term_to_exp kf env t =
Printer.pp_term t generate_rte; Printer.pp_term t generate_rte;
Env.with_rte_and_result env false Env.with_rte_and_result env false
~f:(fun env -> ~f:(fun env ->
let t = match t.term_node with TLogic_coerce(_, t) -> t | _ -> t in
let e, env, sty, name = context_insensitive_term_to_exp kf env t in let e, env, sty, name = context_insensitive_term_to_exp kf env t in
let env = if generate_rte then translate_rte kf env e else env in let env = if generate_rte then translate_rte kf env e else env in
let cast = Typing.get_cast t in let cast = Typing.get_cast t in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment