소스 검색

fixed stack overflow with static setter

Nicolas Cannasse 18 년 전
부모
커밋
88457c9cb1
2개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 0
      doc/CHANGES.txt
  2. 1 1
      typer.ml

+ 1 - 0
doc/CHANGES.txt

@@ -20,6 +20,7 @@
 	fixed Flash9 dynamic runtime type field access
 	fixed Flash9 dynamic runtime type field access
 	fixed very tricky typing bug with constructors inheritance
 	fixed very tricky typing bug with constructors inheritance
 	fixed some documentation related parser bug
 	fixed some documentation related parser bug
+	fixed stack overflow with static setter
 
 
 2007-07-25: 1.14
 2007-07-25: 1.14
 	fixed no error when invalid "catch" expression
 	fixed no error when invalid "catch" expression

+ 1 - 1
typer.ml

@@ -256,7 +256,7 @@ let field_access ctx get f t e p =
 	| NormalAccess | F9MethodAccess ->
 	| NormalAccess | F9MethodAccess ->
 		AccExpr (mk (TField (e,f.cf_name)) t p)
 		AccExpr (mk (TField (e,f.cf_name)) t p)
 	| MethodAccess m ->
 	| MethodAccess m ->
-		if m = ctx.curmethod && e.eexpr = TConst TThis then
+		if m = ctx.curmethod && (match e.eexpr with TConst TThis -> true | TTypeExpr (TClassDecl c) when c == ctx.curclass -> true | _ -> false) then
 			AccExpr (mk (TField (e,f.cf_name)) t p)
 			AccExpr (mk (TField (e,f.cf_name)) t p)
 		else if get then
 		else if get then
 			AccExpr (mk (TCall (mk (TField (e,m)) (mk_mono()) p,[])) t p)
 			AccExpr (mk (TCall (mk (TField (e,m)) (mk_mono()) p,[])) t p)