From 1a563831d6d3365ab52ae40a10aea7222fc38a41 Mon Sep 17 00:00:00 2001 From: KiraCoding <38864051+KiraCoding@users.noreply.github.com> Date: Tue, 27 Aug 2024 14:14:01 +0200 Subject: [PATCH] wip --- examples/sections.rs | 4 ++-- src/section.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/sections.rs b/examples/sections.rs index 69ae560..3872f61 100644 --- a/examples/sections.rs +++ b/examples/sections.rs @@ -2,7 +2,7 @@ use inka::program; fn main() { let program = dbg!(program()); - let text_base = dbg!(program.get_section(".text").unwrap().base()); + let text = dbg!(program.get_section(".text").unwrap()); - dbg!(unsafe { text_base.add(1) }); + dbg!(unsafe { text.add(1) }); } diff --git a/src/section.rs b/src/section.rs index 6e35371..c2da043 100644 --- a/src/section.rs +++ b/src/section.rs @@ -17,9 +17,8 @@ impl Section { self.name } - #[inline] - pub fn base(&self) -> Base { - self.base + pub unsafe fn add(&self, count: usize) -> NonNull { + unsafe { self.base.add(count) } } #[inline]