瀏覽代碼

follow with abstracts to decide on `+ 1` to `++` transformation (#8513)

Aleksandr Kuzmenko 6 年之前
父節點
當前提交
f5009c1a4a
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/optimization/analyzerTexprTransformer.ml

+ 1 - 1
src/optimization/analyzerTexprTransformer.ml

@@ -737,7 +737,7 @@ and func ctx i =
 			begin match e1.eexpr,e2.eexpr with
 				| TLocal v1,TLocal v2 when v1 == v2 && not v1.v_capture && is_valid_assign_op op ->
 					begin match op,e3.eexpr with
-						| (OpAdd|OpSub) as op,TConst (TInt i32) when Int32.to_int i32 = 1 && ExtType.is_numeric (follow v1.v_type) ->
+						| (OpAdd|OpSub) as op,TConst (TInt i32) when Int32.to_int i32 = 1 && ExtType.is_numeric (Abstract.follow_with_abstracts v1.v_type) ->
 							let op = match op with
 								| OpAdd -> Increment
 								| OpSub -> Decrement