소스 검색

write TInt as leb too

Simon Krajewski 1 년 전
부모
커밋
ce6c8de751
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/compiler/hxb/hxbReader.ml
  2. 1 1
      src/compiler/hxb/hxbWriter.ml

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

@@ -982,7 +982,7 @@ class hxb_reader
 					| 2 -> TConst TSuper
 					| 2 -> TConst TSuper
 					| 3 -> TConst (TBool false)
 					| 3 -> TConst (TBool false)
 					| 4 -> TConst (TBool true)
 					| 4 -> TConst (TBool true)
-					| 5 -> TConst (TInt self#read_i32)
+					| 5 -> TConst (TInt (Int32.of_int self#read_leb128))
 					| 6 -> TConst (TFloat self#read_string)
 					| 6 -> TConst (TFloat self#read_string)
 					| 7 -> TConst (TString self#read_string)
 					| 7 -> TConst (TString self#read_string)
 
 

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

@@ -1267,7 +1267,7 @@ class hxb_writer
 					self#write_texpr_byte 4;
 					self#write_texpr_byte 4;
 				| TInt i32 ->
 				| TInt i32 ->
 					self#write_texpr_byte 5;
 					self#write_texpr_byte 5;
-					chunk#write_i32 i32;
+					chunk#write_leb128 (Int32.to_int i32);
 				| TFloat f ->
 				| TFloat f ->
 					self#write_texpr_byte 6;
 					self#write_texpr_byte 6;
 					chunk#write_string f;
 					chunk#write_string f;