Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
KiraCoding committed Aug 27, 2024
1 parent 1ce4001 commit 1a56383
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/sections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) });
}
5 changes: 2 additions & 3 deletions src/section.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ impl Section {
self.name
}

#[inline]
pub fn base(&self) -> Base {
self.base
pub unsafe fn add(&self, count: usize) -> NonNull<u8> {
unsafe { self.base.add(count) }
}

#[inline]
Expand Down

0 comments on commit 1a56383

Please sign in to comment.