fix type of array store

Reviewed By: jeremydubreil

Differential Revision: D3826437

fbshipit-source-id: b36e093
master
Sam Blackshear 8 years ago committed by Facebook Github Bot 1
parent 2f90dde351
commit 30ff9eda22

@ -1089,9 +1089,7 @@ let rec iter_rearrange
L.d_ln();
end;
struct_typ
| Sil.Off_index _ :: off
when !Config.curr_language = Config.Clang
(* TODO(t7651424): turn on for Java. Needs fixing in the frontend *) ->
| Sil.Off_index _ :: off ->
Typ.Tarray (root_typ_of_offsets off, None)
| _ ->
typ_from_instr in

@ -828,13 +828,12 @@ let rec instruction context pc instr : translation =
JContext.add_goto_jump context pc JContext.Exit;
Instr node
| JBir.AffectArray (array_ex, index_ex, value_ex) ->
let (instrs_array, sil_expr_array, arr_type) = expression context pc array_ex
let (instrs_array, sil_expr_array, _) = expression context pc array_ex
and (instrs_index, sil_expr_index, _) = expression context pc index_ex
and (instrs_value, sil_expr_value, _) = expression context pc value_ex in
let arr_type_np = JTransType.extract_cn_type_np arr_type in
and (instrs_value, sil_expr_value, value_typ) = expression context pc value_ex in
let sil_instr =
Sil.Store (
Exp.Lindex (sil_expr_array, sil_expr_index), arr_type_np, sil_expr_value, loc) in
Exp.Lindex (sil_expr_array, sil_expr_index), value_typ, sil_expr_value, loc) in
let final_instrs = instrs_array @ instrs_index @ instrs_value @ [sil_instr] in
let node_kind = Cfg.Node.Stmt_node "method_body" in
let node = create_node node_kind final_instrs in

Loading…
Cancel
Save