Browse Source

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

Aleksandr Kuzmenko 6 years ago
parent
commit
f5009c1a4a
1 changed files with 1 additions and 1 deletions
  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
 			begin match e1.eexpr,e2.eexpr with
 				| TLocal v1,TLocal v2 when v1 == v2 && not v1.v_capture && is_valid_assign_op op ->
 				| TLocal v1,TLocal v2 when v1 == v2 && not v1.v_capture && is_valid_assign_op op ->
 					begin match op,e3.eexpr with
 					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
 							let op = match op with
 								| OpAdd -> Increment
 								| OpAdd -> Increment
 								| OpSub -> Decrement
 								| OpSub -> Decrement