瀏覽代碼

[jvm] fix local var table

Simon Krajewski 5 年之前
父節點
當前提交
987a01de3d
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/generators/jvm/jvmMethod.ml

+ 5 - 1
src/generators/jvm/jvmMethod.ml

@@ -125,12 +125,16 @@ class builder jc name jsig = object(self)
 							| None -> failwith ("Uninitialized local " ^ name);
 							| Some fp -> fp
 						in
+						let t = match t with
+							| TUninitialized None -> TObject(jc#get_this_path,[])
+							| _ -> t
+						in
 						let ld = {
 							ld_start_pc = fp;
 							ld_length = fp_end - fp;
 							ld_name_index = jc#get_pool#add_string name;
 							ld_descriptor_index = jc#get_pool#add_string (generate_signature false t);
-							ld_index = old_offset + i - 1;
+							ld_index = old_offset + i - (signature_size t);
 						} in
 						debug_locals <- ld :: debug_locals;
 						loop (i - (signature_size t)) l