Skip to content

Commit

Permalink
Wrap ModuleUnwindDataInternal in an Arc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mstange committed Apr 11, 2024
1 parent 32d3103 commit 632e9d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/unwinder.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use alloc::string::String;
use alloc::sync::Arc;
use alloc::vec::Vec;
use fallible_iterator::FallibleIterator;
use gimli::{EndianSlice, LittleEndian};
Expand Down Expand Up @@ -394,7 +395,7 @@ impl<D: Deref<Target = [u8]>, A: Unwinding, P: AllocationPolicy> UnwinderInterna
F: FnMut(u64) -> Result<u64, ()>,
{
let is_first_frame = !address.is_return_address();
let unwind_result = match &module.unwind_data {
let unwind_result = match &*module.unwind_data {
#[cfg(feature = "macho")]
ModuleUnwindDataInternal::CompactUnwindInfoAndEhFrame {
unwind_info,
Expand Down Expand Up @@ -759,7 +760,7 @@ pub struct Module<D> {
/// The base address of this module, according to the module.
base_svma: u64,
/// The unwind data that should be used for unwinding addresses from this module.
unwind_data: ModuleUnwindDataInternal<D>,
unwind_data: Arc<ModuleUnwindDataInternal<D>>,
}

/// Information about a module's sections (and segments).
Expand Down Expand Up @@ -971,7 +972,7 @@ impl<D: Deref<Target = [u8]>> Module<D> {
avma_range,
base_avma,
base_svma: section_info.base_svma(),
unwind_data,
unwind_data: Arc::new(unwind_data),
}
}

Expand Down

0 comments on commit 632e9d0

Please sign in to comment.