Skip to content

Commit 8410fe3

Browse files
committed
Looking into the bug found by @abakst
1 parent c104b09 commit 8410fe3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

wllvm/extraction.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import tempfile
99
import shutil
1010
import argparse
11+
import codecs
1112

1213
from .popenwrapper import Popen
1314

@@ -24,6 +25,7 @@
2425

2526
_logger = logConfig(__name__)
2627

28+
decode_hex = codecs.getdecoder("hex_codec")
2729

2830
def extraction():
2931
""" This is the entry point to extract-bc.
@@ -101,7 +103,6 @@ def getSectionContent(size, offset, filename):
101103
# otool hexdata pattern.
102104
otool_hexdata = re.compile(r'^(?:[0-9a-f]{8,16}\t)?([0-9a-f\s]+)$', re.IGNORECASE)
103105

104-
105106
def extract_section_darwin(inputFile):
106107
"""Extracts the section as a string, the darwin version.
107108
@@ -123,7 +124,7 @@ def extract_section_darwin(inputFile):
123124

124125
try:
125126
octets = []
126-
for line in lines:
127+
for line in lines[1:]:
127128
m = otool_hexdata.match(line)
128129
if not m:
129130
_logger.debug('otool output:\n\t%s\nDID NOT match expectations.', line)

0 commit comments

Comments
 (0)