浏览代码

Merge pull request #2562 from nadako/opassignop_rhs_promotion

promote complex right-hand exprs for OpAssignOp as well
Simon Krajewski 11 年之前
父节点
当前提交
a46f5982e8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      filters.ml

+ 1 - 1
filters.ml

@@ -203,7 +203,7 @@ let promote_complex_rhs ctx e =
 		List.rev !r
 	and find e = match e.eexpr with
 		| TReturn (Some e1) -> loop (fun e -> {e with eexpr = TReturn (Some e)}) e1
-		| TBinop(OpAssign, ({eexpr = TLocal _ | TField _ | TArray _} as e1), e2) -> loop (fun er -> {e with eexpr = TBinop(OpAssign, e1, er)}) e2
+		| TBinop(OpAssign | OpAssignOp _ as op, ({eexpr = TLocal _ | TField _ | TArray _} as e1), e2) -> loop (fun er -> {e with eexpr = TBinop(op, e1, er)}) e2
 		| TBlock(el) -> {e with eexpr = TBlock (block el)}
 		| _ -> Type.map_expr find e
 	in