Browse Source

sanitize constructors after adding field inits and running analyzer on them (closes #4877)

Dan Korostelev 9 năm trước cách đây
mục cha
commit
be90dd99d4
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      filters.ml

+ 5 - 0
filters.ml

@@ -870,6 +870,11 @@ let add_field_inits ctx t =
 			in
 			in
 			let config = Analyzer.Config.get_base_config ctx.com false in
 			let config = Analyzer.Config.get_base_config ctx.com false in
 			Analyzer.Run.run_on_field ctx config c cf;
 			Analyzer.Run.run_on_field ctx config c cf;
+			(match cf.cf_expr with
+			| Some e ->
+				cf.cf_expr <- Some (Optimizer.sanitize ctx.com e)
+			| _ ->
+				());
 			c.cl_constructor <- Some cf
 			c.cl_constructor <- Some cf
 	in
 	in
 	match t with
 	match t with