From 339feaa7474fd1809b902683930df400d583b771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Wed, 14 Sep 2011 15:55:29 +0200 Subject: [PATCH] Ignore unknown nodes (instead of crashing) --- compiler/heptagon/transformations/inline.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/heptagon/transformations/inline.ml b/compiler/heptagon/transformations/inline.ml index 1e0801c..1899ff0 100644 --- a/compiler/heptagon/transformations/inline.ml +++ b/compiler/heptagon/transformations/inline.ml @@ -57,6 +57,7 @@ let exp funs (env, newvars, newequs) exp = match exp.e_desc with (exp, (env, newvars, newequs)) | Eapp ({ a_op = (Enode nn | Efun nn); } as op, argl, rso) when to_be_inlined nn -> + begin try let add_reset eq = match rso with | None -> eq | Some x -> mk_equation (Ereset (mk_block [eq], x)) in @@ -98,6 +99,10 @@ let exp funs (env, newvars, newequs) exp = match exp.e_desc with List.map mk_output_exp ni.n_output, None)) exp.e_ty ~linearity:exp.e_linearity in (res_e, (env, newvars, newequs)) + + with + | Not_found -> exp, (env, newvars, newequs) + end | _ -> Hept_mapfold.exp funs (env, newvars, newequs) exp let block funs (env, newvars, newequs) blk =