Quellcode durchsuchen

fix overloads for real

Simon Krajewski vor 1 Jahr
Ursprung
Commit
dfca12b442
2 geänderte Dateien mit 8 neuen und 18 gelöschten Zeilen
  1. 0 10
      src/compiler/hxb/hxbReader.ml
  2. 8 8
      src/compiler/hxb/hxbWriter.ml

+ 0 - 10
src/compiler/hxb/hxbReader.ml

@@ -1477,15 +1477,6 @@ class hxb_reader
 		| 2 ->
 			an.a_status := Extend self#read_types;
 			read_fields ()
-		(* | 3 -> *)
-		(* 	an.a_status := ClassStatics self#read_class_ref; *)
-		(* 	read_fields () *)
-		(* | 4 -> *)
-		(* 	an.a_status := EnumStatics self#read_enum_ref; *)
-		(* 	read_fields () *)
-		(* | 5 -> *)
-		(* 	an.a_status := AbstractStatics self#read_abstract_ref; *)
-		(* 	read_fields () *)
 		| _ -> assert false
 		end;
 
@@ -1681,6 +1672,5 @@ class hxb_reader
 				loop()
 		in
 		loop();
-		(* prerr_endline (Printf.sprintf "Done reading hxb module %s" (s_type_path current_module.m_path)); *)
 		current_module
 end

+ 8 - 8
src/compiler/hxb/hxbWriter.ml

@@ -364,13 +364,11 @@ class ['a] hxb_writer
 		chunk#write_uleb128 index;
 
 	method write_field_ref (c : tclass) (kind : class_field_ref_kind)  (cf : tclass_field) =
-		try
-			chunk#write_uleb128 (class_fields#get cf)
+		let index = try
+			class_fields#get cf
 		with Not_found ->
 			let cf_base = find_field c cf.cf_name kind in
-			let depth,cf = if cf_base.cf_overloads = [] then
-				0,cf
-			else begin
+			let depth,cf =
 				let rec loop depth cfl = match cfl with
 					| cf' :: cfl ->
 						if cf' == cf then
@@ -394,15 +392,17 @@ class ['a] hxb_writer
 							l
 				in
 				loop 0 cfl
-			end in
-			chunk#write_uleb128 (class_fields#add cf (c,kind,depth));
+			in
+			class_fields#add cf (c,kind,depth)
+		in
+		chunk#write_uleb128 index
 
 	method write_enum_field_ref (en : tenum) (ef : tenum_field) =
-		ignore(enums#get_or_add en.e_path en);
 		let key = (en.e_path,ef.ef_name) in
 		try
 			chunk#write_uleb128 (enum_fields#get key)
 		with Not_found ->
+			ignore(enums#get_or_add en.e_path en);
 			chunk#write_uleb128 (enum_fields#add key (en,ef))
 
 	method write_anon_field_ref cf =