Skip to content

Commit 12a1792

Browse files
authored
Support Goblin 0.10 alongside 0.9 (#5337)
1 parent 6e9a7fe commit 12a1792

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

newsfragments/5337.changed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Introspection: add compatibility with Goblin 0.10

pyo3-introspection/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ edition = "2021"
1010

1111
[dependencies]
1212
anyhow = "1"
13-
goblin = "0.9.0"
13+
goblin = ">=0.9, <0.11"
1414
serde = { version = "1", features = ["derive"] }
1515
serde_json = "1"
1616
unicode-ident = "1"

pyo3-introspection/src/introspection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ fn find_introspection_chunks_in_pe(pe: &PE<'_>, library_content: &[u8]) -> Resul
328328
.iter()
329329
.find(|section| section.name().unwrap_or_default() == ".rdata")
330330
.context("No .rdata section found")?;
331-
let rdata_shift = pe.image_base
331+
let rdata_shift = usize::try_from(pe.image_base).context("image_base overflow")?
332332
+ usize::try_from(rdata_data_section.virtual_address)
333333
.context(".rdata virtual_address overflow")?
334334
- usize::try_from(rdata_data_section.pointer_to_raw_data)

0 commit comments

Comments
 (0)