|
@@ -675,11 +675,16 @@ module Fusion = struct
|
|
|
let e2 = replace e2 in
|
|
let e2 = replace e2 in
|
|
|
e2,el
|
|
e2,el
|
|
|
| Php | Cpp when not (Common.defined com Define.Cppia) ->
|
|
| Php | Cpp when not (Common.defined com Define.Cppia) ->
|
|
|
- let e2 = match e1.eexpr with
|
|
|
|
|
- (* PHP doesn't like call()() expressions. *)
|
|
|
|
|
- | TCall _ when com.platform = Php -> explore e2
|
|
|
|
|
- | _ -> replace e2
|
|
|
|
|
|
|
+ let is_php_safe e1 =
|
|
|
|
|
+ let rec loop e = match e.eexpr with
|
|
|
|
|
+ | TCall _ -> raise Exit
|
|
|
|
|
+ | TCast(e1,_) | TParenthesis e1 | TMeta(_,e1) -> loop e1
|
|
|
|
|
+ | _ -> ()
|
|
|
|
|
+ in
|
|
|
|
|
+ try loop e1; true with Exit -> false
|
|
|
in
|
|
in
|
|
|
|
|
+ (* PHP doesn't like call()() expressions. *)
|
|
|
|
|
+ let e2 = if com.platform = Php && not (is_php_safe e1) then explore e2 else replace e2 in
|
|
|
let el = handle_el el in
|
|
let el = handle_el el in
|
|
|
e2,el
|
|
e2,el
|
|
|
| _ ->
|
|
| _ ->
|