[sledge] Add missing i32 to i64 conversion for gep indices

Reviewed By: jvillard

Differential Revision: D14344289

fbshipit-source-id: 10e99f37e
master
Josh Berdine 6 years ago committed by Facebook Github Bot
parent 0af0d3b210
commit d769718192

@ -366,7 +366,11 @@ let typ_of = function
let typ = typ_of
let type_check e typ =
assert (Option.for_all ~f:(Typ.castable typ) (typ_of e))
assert (
Option.for_all ~f:(Typ.castable typ) (typ_of e)
|| fail "%a@ : %a not <:@ %a" pp e Typ.pp
(Option.value_exn (typ_of e))
Typ.pp typ )
let type_check2 e f typ = type_check e typ ; type_check f typ

@ -532,7 +532,11 @@ and xlate_opcode : x -> Llvm.llvalue -> Llvm.Opcode.t -> Exp.t =
[%Trace.call fun {pf} ->
pf "%i %a" i pp_llvalue (Llvm.operand llv i)]
;
let idx = xlate_rand i in
let idx =
Exp.convert ~dst:Typ.siz
~src:(xlate_type x (Llvm.type_of (Llvm.operand llv i)))
(xlate_rand i)
in
( if i = 1 then
let base = xlate_rand 0 in
let lltyp = Llvm.type_of (Llvm.operand llv 0) in

Loading…
Cancel
Save