From a8f2a0ba2b97a0aa2a83b32b44932de876e6b4be Mon Sep 17 00:00:00 2001 From: Alasdair Date: Thu, 6 Sep 2018 21:04:54 +0100 Subject: C: Fix a bug with shadowing in nested let-bindings --- src/anf.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/anf.ml b/src/anf.ml index d4ad86b8..e87f2bfd 100644 --- a/src/anf.ml +++ b/src/anf.ml @@ -196,7 +196,7 @@ let rec aexp_rename from_id to_id (AE_aux (aexp, env, l)) = | AE_cast (aexp, typ) -> AE_cast (recur aexp, typ) | AE_assign (id, typ, aexp) when Id.compare from_id id = 0 -> AE_assign (to_id, typ, aexp_rename from_id to_id aexp) | AE_assign (id, typ, aexp) -> AE_assign (id, typ, aexp_rename from_id to_id aexp) - | AE_let (mut, id, typ1, aexp1, aexp2, typ2) when Id.compare from_id id = 0 -> AE_let (mut, id, typ1, aexp1, aexp2, typ2) + | AE_let (mut, id, typ1, aexp1, aexp2, typ2) when Id.compare from_id id = 0 -> AE_let (mut, id, typ1, recur aexp1, aexp2, typ2) | AE_let (mut, id, typ1, aexp1, aexp2, typ2) -> AE_let (mut, id, typ1, recur aexp1, recur aexp2, typ2) | AE_block (aexps, aexp, typ) -> AE_block (List.map recur aexps, recur aexp, typ) | AE_return (aval, typ) -> AE_return (aval_rename from_id to_id aval, typ) -- cgit v1.2.3