[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
match typ.Typ.desc with | None ->
| Tptr (typ, _) -> None
typ | Some typ -> (
| Tarray {elt} -> match typ.Typ.desc with
elt | Tptr (typ, _) ->
| Tvoid -> Some typ
Typ.void | Tarray {elt} ->
| Tstruct typename -> ( Some elt
match BufferOverrunTypModels.dispatch tenv typename with | Tvoid ->
| Some (CArray {element_typ}) -> Some Typ.void
element_typ | Tstruct typename -> (
| Some _ -> match BufferOverrunTypModels.dispatch tenv typename with
L.(die InternalError) | Some (CArray {element_typ}) ->
"Deref of non-array modeled type `%a`" Typ.Name.pp typename Some element_typ
| None -> | Some _ ->
L.(die InternalError) "Deref of unmodeled type `%a`" Typ.Name.pp typename ) L.internal_error "Deref of non-array modeled type `%a`" Typ.Name.pp typename ;
| _ -> None
L.(die InternalError) "Untyped expression is given." ) | None ->
L.(die InternalError) "Deref of unmodeled type `%a`" Typ.Name.pp typename )
| _ ->
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