浏览代码

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
 					| 3 -> TConst (TBool false)
 					| 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)
 					| 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;
 				| TInt i32 ->
 					self#write_texpr_byte 5;
-					chunk#write_i32 i32;
+					chunk#write_leb128 (Int32.to_int i32);
 				| TFloat f ->
 					self#write_texpr_byte 6;
 					chunk#write_string f;