소스 검색

don't recurse over @:to function calls (fixed issue #1568)

Simon Krajewski 12 년 전
부모
커밋
a1af4aa9f6
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      codegen.ml

+ 3 - 0
codegen.ml

@@ -1409,6 +1409,9 @@ let handle_abstract_casts ctx e =
 			let e1 = loop e1 in
 			let e1 = loop e1 in
 			begin try
 			begin try
 				begin match e1.eexpr with
 				begin match e1.eexpr with
+ 					| TField(_,FStatic(_,cf)) when Meta.has Meta.To cf.cf_meta ->
+ 						(* do not recurse over @:to functions to avoid infinite recursion *)
+						{ e with eexpr = TCall(e1,el)}
 					| TField(e2,fa) ->
 					| TField(e2,fa) ->
 						begin match follow e2.etype with
 						begin match follow e2.etype with
 							| TAbstract(a,pl) when Meta.has Meta.MultiType a.a_meta ->
 							| TAbstract(a,pl) when Meta.has Meta.MultiType a.a_meta ->