[inferbo] Fix inferbo error for ondemand paths of Java Collections

Reviewed By: mbouaziz, jvillard

Differential Revision: D14911655

fbshipit-source-id: 9f21876ed
master
Ezgi Çiçek 6 years ago committed by Facebook Github Bot
parent 52fd4c50de
commit 997ba7c151

@ -26,26 +26,29 @@ let mk pdesc =
let rec typ_of_param_path = function let rec typ_of_param_path = function
| SPath.Pvar x -> | SPath.Pvar x ->
FormalTyps.find_opt x formal_typs FormalTyps.find_opt x formal_typs
| SPath.Deref (_, x) -> | SPath.Deref (_, x) -> (
Option.map (typ_of_param_path x) ~f:(fun typ -> match typ_of_param_path x with
| None ->
None
| Some typ -> (
match typ.Typ.desc with match typ.Typ.desc with
| Tptr (typ, _) -> | Tptr (typ, _) ->
typ Some typ
| Tarray {elt} -> | Tarray {elt} ->
elt Some elt
| Tvoid -> | Tvoid ->
Typ.void Some Typ.void
| Tstruct typename -> ( | Tstruct typename -> (
match BufferOverrunTypModels.dispatch tenv typename with match BufferOverrunTypModels.dispatch tenv typename with
| Some (CArray {element_typ}) -> | Some (CArray {element_typ}) ->
element_typ Some element_typ
| Some _ -> | Some _ ->
L.(die InternalError) L.internal_error "Deref of non-array modeled type `%a`" Typ.Name.pp typename ;
"Deref of non-array modeled type `%a`" Typ.Name.pp typename None
| None -> | None ->
L.(die InternalError) "Deref of unmodeled type `%a`" Typ.Name.pp typename ) L.(die InternalError) "Deref of unmodeled type `%a`" Typ.Name.pp typename )
| _ -> | _ ->
L.(die InternalError) "Untyped expression is given." ) L.(die InternalError) "Untyped expression is given." ) )
| SPath.Field (fn, x) -> ( | SPath.Field (fn, x) -> (
match BufferOverrunField.get_type fn with match BufferOverrunField.get_type fn with
| None -> | None ->

Loading…
Cancel
Save