(
&self,
symbol: &Symbol,
section: &Section,
mut next_address: u64,
)
| 459 | } |
| 460 | |
| 461 | fn infer_function_size( |
| 462 | &self, |
| 463 | symbol: &Symbol, |
| 464 | section: &Section, |
| 465 | mut next_address: u64, |
| 466 | ) -> Result<u64> { |
| 467 | // TODO: This should probably check the disasm mode and trim accordingly, |
| 468 | // but self.disasm_modes isn't populated until post_init, so it needs a refactor. |
| 469 | |
| 470 | // Trim any trailing 2-byte zeroes from the end (padding) |
| 471 | while next_address >= symbol.address + 2 |
| 472 | && let Some(data) = section.data_range(next_address - 2, 2) |
| 473 | && data == [0u8; 2] |
| 474 | && section.relocation_at(next_address - 2, 2).is_none() |
| 475 | { |
| 476 | next_address -= 2; |
| 477 | } |
| 478 | Ok(next_address.saturating_sub(symbol.address)) |
| 479 | } |
| 480 | } |
| 481 | |
| 482 | #[derive(Clone, Copy, Debug)] |
no test coverage detected