Browse Source

write cl_flags in MTF

We want to know early if a class is an interface
Simon Krajewski 1 year ago
parent
commit
f4220309a0
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/compiler/hxb/hxbReader.ml
  2. 1 1
      src/compiler/hxb/hxbWriter.ml

+ 1 - 1
src/compiler/hxb/hxbReader.ml

@@ -1402,7 +1402,6 @@ class hxb_reader
 	method read_class (c : tclass) =
 		self#read_common_module_type (Obj.magic c);
 		c.cl_kind <- self#read_class_kind;
-		c.cl_flags <- read_uleb128 ch;
 		let read_relation () =
 			let c = self#read_class_ref in
 			let tl = self#read_types in
@@ -1695,6 +1694,7 @@ class hxb_reader
 			| 0 ->
 				let c = mk_class current_module path pos name_pos in
 				c.cl_params <- Array.to_list params;
+				c.cl_flags <- read_uleb128 ch;
 
 				let read_field () =
 					self#read_class_field_forward;

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

@@ -1876,7 +1876,6 @@ class hxb_writer
 		end;
 		self#write_common_module_type (Obj.magic c);
 		self#write_class_kind c.cl_kind;
-		IOChunk.write_uleb128 chunk.io c.cl_flags;
 		Chunk.write_option chunk c.cl_super (fun (c,tl) ->
 			self#write_class_ref c;
 			self#write_types tl
@@ -2017,6 +2016,7 @@ class hxb_writer
 		(* Forward declare fields *)
 		match mt with
 		| TClassDecl c ->
+			IOChunk.write_uleb128 chunk.io c.cl_flags;
 			Chunk.write_option chunk c.cl_constructor self#write_class_field_forward;
 			Chunk.write_list chunk c.cl_ordered_fields self#write_class_field_forward;
 			Chunk.write_list chunk c.cl_ordered_statics self#write_class_field_forward;