Explorar o código

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

Dan Korostelev %!s(int64=9) %!d(string=hai) anos
pai
achega
be90dd99d4
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      filters.ml

+ 5 - 0
filters.ml

@@ -870,6 +870,11 @@ let add_field_inits ctx t =
 			in
 			let config = Analyzer.Config.get_base_config ctx.com false in
 			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
 	in
 	match t with