remove superfluous byte swap in linkersymbol builtin translation (#455)

- Remove the superfluous byte swap in the `linkersymbol` builtin
translation.
- Support testing the `linkersymbol` builtin translation in the runner
specs.

---------

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
xermicus authored and GitHub committed 2026-01-15 12:43:46 +01:00
1 parent 2d85ca9755
commit 289af875db
12 files changed
+498 -345

No files matched your search

@@ -748,7 +748,7 @@ impl<'ctx> Context<'ctx> {
&self,
pointer: Pointer<'ctx>,
) -> anyhow::Result<inkwell::values::BasicValueEnum<'ctx>> {
let address = self.build_byte_swap(self.build_load(pointer, "address_pointer")?)?;
let address = self.build_byte_swap(self.build_load(pointer, "address_value")?)?;
Ok(self
.builder()
.build_int_z_extend(address.into_int_value(), self.word_type(), "address_zext")?
+10 -1
View File
@@ -163,7 +163,16 @@ pub fn linker_symbol<'ctx>(
context.integer_type(revive_common::BIT_LENGTH_ETH_ADDRESS),
Default::default(),
);
context.build_load_address(context.get_global(path)?.into())
let symbol = context.get_global(path)?;
let value = context.build_load(symbol.into(), path)?;
let value = context.builder().build_int_z_extend(
value.into_int_value(),
context.word_type(),
&format!("{path}_zext"),
)?;
Ok(value.into())
}
/// The runtime implements gas as `u64` so we clip the stipend to `u64::MAX`.