瀏覽代碼

bugfix with inline when modifying var with same name as one of current local (#33)

Nicolas Cannasse 15 年之前
父節點
當前提交
390d8a55c8
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 1 0
      doc/CHANGES.txt
  2. 2 2
      optimizer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -1,6 +1,7 @@
 2010-??-??: 2.06
 	neko : change serializer to be able to handle instances of basic classes from other modules
 	js : add Document.createTextNode
+	all : bugfix with inline when modifying var with same name as one of current local
 
 2010-01-09: 2.05
 	js : added js.Scroll

+ 2 - 2
optimizer.ml

@@ -126,12 +126,12 @@ let type_inline ctx cf f ethis params tret p =
 			Type.map_expr (map term) e
 		| TUnop (op,pref,({ eexpr = TLocal s } as e1)) ->
 			(match op with
-			| Increment | Decrement -> Hashtbl.add lsets s ()
+			| Increment | Decrement -> Hashtbl.add lsets (local s) ()
 			| _ -> ());
 			{ e with eexpr = TUnop (op,pref,map false e1) }
 		| TBinop (op,({ eexpr = TLocal s } as e1),e2) ->
 			(match op with
-			| OpAssign | OpAssignOp _ -> Hashtbl.add lsets s ()
+			| OpAssign | OpAssignOp _ -> Hashtbl.add lsets (local s) ()
 			| _ -> ());
 			{ e with eexpr = TBinop (op,map false e1,map false e2) }
 		| TConst TSuper ->