From 01d4a08e8aa3b974a36ce2d906be5931efdebb00 Mon Sep 17 00:00:00 2001 From: Arnaud DABY-SEESARAM Date: Mon, 19 Dec 2022 14:30:39 +0100 Subject: [PATCH] [c pass] idem --- src/ctranslation.ml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ctranslation.ml b/src/ctranslation.ml index 2470737..9113c5b 100644 --- a/src/ctranslation.ml +++ b/src/ctranslation.ml @@ -98,11 +98,20 @@ let rec merge_neighbour_ifs = function | CIf (c, e1, e2) :: CIf (c', e'1, e'2) :: b -> begin if c = c' then - merge_neighbour_ifs (CIf (c, e1 @ e'1, e2 @ e'2) :: b) + merge_neighbour_ifs + (CIf (c, + merge_neighbour_ifs (e1 @ e'1), + merge_neighbour_ifs (e2 @ e'2)) :: b) else if c = CMonOp (MOp_not, c') then - merge_neighbour_ifs (CIf (c, e1 @ e'2, e2 @ e'1) :: b) + merge_neighbour_ifs + (CIf (c', + merge_neighbour_ifs (e2 @ e'1), + merge_neighbour_ifs (e1 @ e'2)) :: b) else if c' = CMonOp (MOp_not, c) then - merge_neighbour_ifs (CIf (c, e1 @ e'2, e2 @ e'1) :: b) + merge_neighbour_ifs + (CIf (c, + merge_neighbour_ifs (e1 @ e'2), + merge_neighbour_ifs (e2 @ e'1)) :: b) else CIf (c, e1, e2) :: merge_neighbour_ifs (CIf (c', e'1, e'2) :: b) end | stmt :: stmt' :: b ->