[inferbo] Fix a bug in eval_arr

Summary:
This diff fixes a bug that eval_arr misses the case when a stack
variable points to an array.

Reviewed By: ezgicicek, roro47

Differential Revision: D22596999

fbshipit-source-id: 7c4a13d01
master
Sungkeun Cho 4 years ago committed by Facebook GitHub Bot
parent 8d648b9c5a
commit 831741c5eb

@ -304,8 +304,11 @@ let rec eval_arr : Typ.IntegerWidths.t -> Exp.t -> Mem.t -> Val.t =
fun integer_type_widths exp mem -> fun integer_type_widths exp mem ->
match exp with match exp with
| Exp.Var id -> | Exp.Var id ->
let alias_loc = AliasTargets.find_simple_alias (Mem.find_alias_id id mem) in let loc =
Option.value_map alias_loc ~default:Val.bot ~f:(fun loc -> Mem.find loc mem) AliasTargets.find_simple_alias (Mem.find_alias_id id mem)
|> IOption.value_default_f ~f:(fun () -> Loc.of_id id)
in
Mem.find loc mem
| Exp.Lvar pvar -> | Exp.Lvar pvar ->
Mem.find (Loc.of_pvar pvar) mem Mem.find (Loc.of_pvar pvar) mem
| Exp.BinOp (bop, e1, e2) -> | Exp.BinOp (bop, e1, e2) ->

Loading…
Cancel
Save