Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pub enum Error {
UnknownMagic(u32),
#[error("unknown symbol type, {0}.")]
UnknownSymType(u8),
#[error("unknown export symbol kind, {0}.")]
UnknownExportSymKind(u8),
#[error("offset {0} out of range: {1:?}.")]
OutOfRange(usize, Range<usize>),
#[error("number overflowing.")]
Expand Down
4 changes: 2 additions & 2 deletions src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::io::Cursor;
use byteorder::ReadBytesExt;

use crate::commands::CursorExt;
use crate::consts::*;
use crate::errors::{Error::*, Result};
use crate::{consts::*, MachError};

#[derive(Clone, Copy, Debug, PartialEq)]
pub enum ExportKind {
Expand Down Expand Up @@ -41,7 +41,7 @@ impl Exported {
EXPORT_SYMBOL_FLAGS_KIND_REGULAR => ExportKind::Regular,
EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL => ExportKind::ThreadLocal,
EXPORT_SYMBOL_FLAGS_KIND_ABSOLUTE => ExportKind::Absolute,
_ => unreachable!(),
invalid => return Err(MachError::UnknownExportSymKind(invalid)),
};

let flags = ExportSymbolFlags::from_bits_truncate(flags as u32);
Expand Down