瀏覽代碼

adjust "for" loop positions to comply with test #5172. Take 2

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

+ 1 - 1
src/typing/forLoop.ml

@@ -330,7 +330,7 @@ module IterationKind = struct
 		| IteratorIntConst(a,b,ascending) ->
 			check_loop_var_modification [v] e2;
 			if not ascending then error "Cannot iterate backwards" p;
-			let v_index = gen_local ctx t_int v.v_pos in
+			let v_index = gen_local ctx t_int a.epos in
 			let evar_index = mk (TVar(v_index,Some a)) t_void a.epos in
 			let ev_index = make_local v_index v_index.v_pos in
 			let op1,op2 = if ascending then (OpLt,Increment) else (OpGt,Decrement) in