|
|
@@ -189,19 +189,12 @@ pub(super) fn process_instruction<'a, T: TargetRuntime<'a> + ?Sized>(
|
|
|
let size = bin.builder.build_int_mul(elem_size, new_len, "");
|
|
|
let size = bin.builder.build_int_add(size, vec_size, "");
|
|
|
|
|
|
- let realloc_size = if ns.target == Target::Solana {
|
|
|
- bin.builder
|
|
|
- .build_int_z_extend(size, bin.context.i64_type(), "")
|
|
|
- } else {
|
|
|
- size
|
|
|
- };
|
|
|
-
|
|
|
// Reallocate and reassign the array pointer
|
|
|
let new = bin
|
|
|
.builder
|
|
|
.build_call(
|
|
|
bin.module.get_function("__realloc").unwrap(),
|
|
|
- &[arr.into(), realloc_size.into()],
|
|
|
+ &[arr.into(), size.into()],
|
|
|
"",
|
|
|
)
|
|
|
.try_as_basic_value()
|
|
|
@@ -355,19 +348,11 @@ pub(super) fn process_instruction<'a, T: TargetRuntime<'a> + ?Sized>(
|
|
|
}
|
|
|
|
|
|
// Reallocate and reassign the array pointer
|
|
|
-
|
|
|
- let realloc_size = if ns.target == Target::Solana {
|
|
|
- bin.builder
|
|
|
- .build_int_z_extend(size, bin.context.i64_type(), "")
|
|
|
- } else {
|
|
|
- size
|
|
|
- };
|
|
|
-
|
|
|
let new = bin
|
|
|
.builder
|
|
|
.build_call(
|
|
|
bin.module.get_function("__realloc").unwrap(),
|
|
|
- &[a.into(), realloc_size.into()],
|
|
|
+ &[a.into(), size.into()],
|
|
|
"",
|
|
|
)
|
|
|
.try_as_basic_value()
|