diff --git a/src/structArrayExpand.ml b/src/structArrayExpand.ml index 8ed8894c4db9c7acaf2ccd150bcbe667a9059a73..f78b21133298dfc4c96bf127c732a8e24123f6f7 100644 --- a/src/structArrayExpand.ml +++ b/src/structArrayExpand.ml @@ -290,13 +290,27 @@ and (break_tuple : Lxm.t -> left list -> val_exp -> Eff.eq_info srcflagged list) if not !Global.ec then [{ src = lxm ; it = (left_list, ve) }] else - (* we only need to break tuple in this mode ... + (* we only need to break tuples in this mode ... Note that this work only if the node expansion has already been done! + (otherwise, we would not have the same number of items in the left and + in the rigth part) *) let rec aux ve = (* flatten val exp*) match ve with - | CallByPosEff ({it=TUPLE}, OperEff vel) -> List.flatten (List.map aux vel) - | _ -> [ve] + | CallByPosEff ({it= TUPLE}, OperEff vel) -> List.flatten (List.map aux vel) + | CallByPosEff (unop, OperEff [ve1]) -> + let ve1l = aux ve1 in + List.map + (fun ve1 -> CallByPosEff (unop, OperEff [ve1])) + ve1l + | CallByPosEff (binop, OperEff [ve1;ve2]) -> + let ve1l, ve2l = aux ve1, aux ve2 in + List.map2 + (fun ve1 ve2 -> CallByPosEff (binop, OperEff [ve1;ve2])) + ve1l + ve2l + + | _ -> [ve] in let vel = aux ve in if (List.length vel <> List.length left_list) then