mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-15 02:11:08 +00:00
@@ -51,8 +51,8 @@ pub fn copy<'ctx, D>(
|
||||
where
|
||||
D: Dependency + Clone,
|
||||
{
|
||||
let offset = context.safe_truncate_int_to_i32(destination_offset)?;
|
||||
let size = context.safe_truncate_int_to_i32(size)?;
|
||||
let offset = context.safe_truncate_int_to_xlen(destination_offset)?;
|
||||
let size = context.safe_truncate_int_to_xlen(size)?;
|
||||
let destination = context.build_heap_gep(offset, size)?;
|
||||
|
||||
let calldata_pointer = context
|
||||
@@ -61,7 +61,7 @@ where
|
||||
.as_pointer_value();
|
||||
let source = context.build_gep(
|
||||
Pointer::new(context.byte_type(), AddressSpace::Stack, calldata_pointer),
|
||||
&[context.safe_truncate_int_to_i32(source_offset)?],
|
||||
&[context.safe_truncate_int_to_xlen(source_offset)?],
|
||||
context.byte_type(),
|
||||
"calldata_pointer_with_offset",
|
||||
);
|
||||
|
||||
@@ -13,8 +13,8 @@ pub fn sha3<'ctx, D>(
|
||||
where
|
||||
D: Dependency + Clone,
|
||||
{
|
||||
let offset_casted = context.safe_truncate_int_to_i32(offset)?;
|
||||
let length_casted = context.safe_truncate_int_to_i32(length)?;
|
||||
let offset_casted = context.safe_truncate_int_to_xlen(offset)?;
|
||||
let length_casted = context.safe_truncate_int_to_xlen(length)?;
|
||||
let input_pointer = context.build_heap_gep(offset_casted, length_casted)?;
|
||||
let input_pointer_casted = context.builder().build_ptr_to_int(
|
||||
input_pointer.value,
|
||||
|
||||
@@ -61,13 +61,17 @@ where
|
||||
)?;
|
||||
|
||||
context.build_exit(
|
||||
context.integer_const(32, 0),
|
||||
context.integer_const(crate::polkavm::XLEN, 0),
|
||||
context.field_const(crate::polkavm::HEAP_AUX_OFFSET_CONSTRUCTOR_RETURN_DATA),
|
||||
return_data_length,
|
||||
)?;
|
||||
}
|
||||
Some(CodeType::Runtime) => {
|
||||
context.build_exit(context.integer_const(32, 0), offset, length)?;
|
||||
context.build_exit(
|
||||
context.integer_const(crate::polkavm::XLEN, 0),
|
||||
offset,
|
||||
length,
|
||||
)?;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,7 +87,11 @@ pub fn revert<'ctx, D>(
|
||||
where
|
||||
D: Dependency + Clone,
|
||||
{
|
||||
context.build_exit(context.integer_const(32, 1), offset, length)
|
||||
context.build_exit(
|
||||
context.integer_const(crate::polkavm::XLEN, 1),
|
||||
offset,
|
||||
length,
|
||||
)
|
||||
}
|
||||
|
||||
/// Translates the `stop` instruction.
|
||||
@@ -94,8 +102,8 @@ where
|
||||
{
|
||||
r#return(
|
||||
context,
|
||||
context.integer_const(32, 0),
|
||||
context.integer_const(32, 0),
|
||||
context.integer_const(crate::polkavm::XLEN, 0),
|
||||
context.integer_const(crate::polkavm::XLEN, 0),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user