Skip to content

Commit

Permalink
fix make_constant_expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Simn committed Feb 20, 2015
1 parent d31885e commit ebac64a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion optimizer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,16 @@ let rec make_constant_expression ctx ?(concat_strings=false) e =
(match make_constant_expression ctx e1 with
| None -> None
| Some e1 -> Some {e with eexpr = TCast(e1,None)})
| TParenthesis e | TMeta(_,e) -> Some e
| TParenthesis e1 ->
begin match make_constant_expression ctx ~concat_strings e1 with
| None -> None
| Some e1 -> Some {e with eexpr = TParenthesis e1}
end
| TMeta(m,e1) ->
begin match make_constant_expression ctx ~concat_strings e1 with
| None -> None
| Some e1 -> Some {e with eexpr = TMeta(m,e1)}
end
| TTypeExpr _ -> Some e
(* try to inline static function calls *)
| TCall ({ etype = TFun(_,ret); eexpr = TField (_,FStatic (c,cf)) },el) ->
Expand Down

0 comments on commit ebac64a

Please sign in to comment.