diff --git a/infer/src/java/jConfig.ml b/infer/src/java/jConfig.ml index 02fd21e29..fe3aa65d5 100644 --- a/infer/src/java/jConfig.ml +++ b/infer/src/java/jConfig.ml @@ -7,7 +7,6 @@ *) open! IStd -open Javalib_pack (** {2 Class names and types} *) @@ -15,12 +14,6 @@ let builtins_package = "com.facebook.infer.builtins" let infer_builtins_cl = builtins_package ^ ".InferBuiltins" -let obj_type = JBasics.TObject (JBasics.TClass JBasics.java_lang_object) - -let string_cl = "java.lang.String" - -let class_cl = "java.lang.Class" - let npe_cl = "java.lang.NullPointerException" let cce_cl = "java.lang.ClassCastException" diff --git a/infer/src/java/jConfig.mli b/infer/src/java/jConfig.mli index 40a1919ec..7494728ca 100644 --- a/infer/src/java/jConfig.mli +++ b/infer/src/java/jConfig.mli @@ -6,13 +6,6 @@ *) open! IStd -open Javalib_pack - -val string_cl : string - -val class_cl : string - -val obj_type : JBasics.value_type val boolean_code : string diff --git a/infer/src/java/jTrans.ml b/infer/src/java/jTrans.ml index 67213cac0..6e11af20a 100644 --- a/infer/src/java/jTrans.ml +++ b/infer/src/java/jTrans.ml @@ -175,6 +175,10 @@ let get_constant (c : JBir.const) = Const.Cint (IntLit.of_int64 i64) | `String jstr -> Const.Cstr (JBasics.jstr_pp jstr) + | `MethodType _ -> + raise (Frontend_error "MethodType constant") + | `MethodHandle _ -> + raise (Frontend_error "MethodHandle constant") let get_binop typ binop = @@ -256,7 +260,7 @@ let get_bytecode cm = Array.map ~f:(function | JCode.OpInvoke (`Dynamic _, ms) -> - JCode.OpInvoke (`Static JBasics.java_lang_object, ms) + JCode.OpInvoke (`Static (`Class, JBasics.java_lang_object), ms) | opcode -> opcode ) bytecode.JCode.c_code diff --git a/infer/src/java/jTransType.ml b/infer/src/java/jTransType.ml index 1a87f16af..05e6865e4 100644 --- a/infer/src/java/jTransType.ml +++ b/infer/src/java/jTransType.ml @@ -51,23 +51,7 @@ let cast_type = function Typ.mk (Typ.Tint Typ.IShort) -let const_type const = - match const with - | `String _ -> - JBasics.TObject (JBasics.TClass (JBasics.make_cn JConfig.string_cl)) - | `Class _ -> - JBasics.TObject (JBasics.TClass (JBasics.make_cn JConfig.class_cl)) - | `Double _ -> - JBasics.TBasic `Double - | `Int _ -> - JBasics.TBasic `Int - | `Float _ -> - JBasics.TBasic `Float - | `Long _ -> - JBasics.TBasic `Long - | `ANull -> - JConfig.obj_type - +let const_type const = JBir.type_of_expr (JBir.Const const) let typename_of_classname cn = Typ.Name.Java.from_string (JBasics.cn_name cn) diff --git a/opam.locked b/opam.locked index 950b340e8..e6aa01ed0 100644 --- a/opam.locked +++ b/opam.locked @@ -53,14 +53,14 @@ depends: [ "cppo" {= "1.6.5"} "cppo_ocamlbuild" {= "1.6.0"} "ctypes" {= "0.14.0"} - "dune" {= "1.6.2"} + "dune" {= "1.6.3"} "easy-format" {= "1.3.1"} "elina" {= "1.1"} "extlib" {= "1.7.5"} "fieldslib" {= "v0.11.0"} "integers" {= "0.2.2"} "jane-street-headers" {= "v0.11.0"} - "javalib" {= "2.3.6"} + "javalib" {= "3.0"} "jbuilder" {= "transition"} "menhir" {= "20181113"} "mlgmpidl" {= "1.2.7"} @@ -108,7 +108,7 @@ depends: [ "ppxlib" {= "0.3.1"} "re" {= "1.8.0"} "result" {= "1.3"} - "sawja" {= "1.5.5"} + "sawja" {= "1.5.6"} "seq" {= "base"} "sexplib" {= "v0.11.0"} "sexplib0" {= "v0.11.0"}