Преглед изворни кода

[tre] better check for static methods

Aleksandr Kuzmenko пре 6 година
родитељ
комит
2bba946960
1 измењених фајлова са 1 додато и 4 уклоњено
  1. 1 4
      src/filters/tre.ml

+ 1 - 4
src/filters/tre.ml

@@ -203,10 +203,7 @@ let rec has_tail_recursion is_recursive_call cancel_tre function_end e =
 let run ctx e =
 	match e.eexpr with
 	| TFunction fn ->
-		let is_tre_eligible =
-			has_class_field_flag ctx.curfield CfFinal
-			|| PMap.exists ctx.curfield.cf_name ctx.curclass.cl_statics
-		in
+		let is_tre_eligible = ctx.curfun = FunStatic || has_class_field_flag ctx.curfield CfFinal in
 		let is_recursive_call callee args =
 			is_tre_eligible && is_recursive_method_call ctx.curclass ctx.curfield callee args
 		in