Skip to content

Commit db7b83e

Browse files
committed
MachO: check symbols instead of imports. fixes issue #44
1 parent 9deec1a commit db7b83e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/macho.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,19 @@ pub trait Properties {
176176
}
177177
impl Properties for MachO<'_> {
178178
fn has_arc(&self) -> bool {
179-
if let Ok(imports) = self.imports() {
180-
for import in &imports {
181-
if import.name == "_objc_release" {
179+
for i in self.symbols() {
180+
if let Ok((symbol,_)) = i {
181+
if symbol == "_objc_release" {
182182
return true;
183183
}
184184
}
185185
}
186186
false
187187
}
188188
fn has_canary(&self) -> bool {
189-
if let Ok(imports) = self.imports() {
190-
for import in &imports {
191-
match import.name {
189+
for i in self.symbols() {
190+
if let Ok((symbol,_)) = i {
191+
match symbol {
192192
"___stack_chk_fail" | "___stack_chk_guard" => return true,
193193
_ => continue,
194194
}

0 commit comments

Comments
 (0)