let rec shift_loc (mem:M.mem) l typ_l = function
    | NoOffset -> l
    | Field(f,next) ->
        shift_loc mem (M.field l f) f.ftype next
    | Index(e,next) ->
        let v = !expr_rec mem e in
        let k = int_of_value v in
        let typ_elt = Cil.typeOf_array_elem typ_l in
        shift_loc mem (M.index l (Ctypes.object_of typ_elt) k) typ_elt next