Don't raise in mach_data so the debugger doesn't catch it

Closes Homebrew/homebrew#33088.
This commit is contained in:
Jack Nagel 2014-10-10 19:21:46 -05:00
parent 8cc5aabfcf
commit 01397d17f7

View File

@ -53,7 +53,10 @@ module MachO
# /usr/include/mach-o/fat.h # /usr/include/mach-o/fat.h
def mach_data def mach_data
@mach_data ||= begin @mach_data ||= _mach_data
end
def _mach_data
offsets = [] offsets = []
mach_data = [] mach_data = []
@ -73,7 +76,7 @@ module MachO
when 0x7f454c46 # ELF when 0x7f454c46 # ELF
mach_data << { :arch => :x86_64, :type => :executable } mach_data << { :arch => :x86_64, :type => :executable }
else else
raise "Not a Mach-O binary." return []
end end
offsets.each do |offset| offsets.each do |offset|
@ -94,10 +97,8 @@ module MachO
mach_data << { :arch => arch, :type => type } mach_data << { :arch => arch, :type => type }
end end
mach_data mach_data
rescue
[]
end
end end
def archs def archs