Skip to content

Commit 5592a15

Browse files
committed
Revert "Fix data tooltip panic"
This reverts commit 462453c.
1 parent 462453c commit 5592a15

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

objdiff-core/src/arch/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,9 @@ pub enum DataType {
3434

3535
impl DataType {
3636
pub fn display_bytes<Endian: ByteOrder>(&self, bytes: &[u8]) -> Option<String> {
37-
let Some(required_len) = self.required_len() else {
37+
if self.required_len().is_some_and(|l| bytes.len() < l) {
3838
return None;
39-
};
40-
// TODO: For symbols larger than their data type, we should probably support
41-
// using the relocation's relative offset to read the bytes.
42-
let bytes = bytes.get(0..required_len)?;
39+
}
4340

4441
match self {
4542
DataType::Int8 => {

0 commit comments

Comments
 (0)