convert str input to bytes

StringRefMemoryObject constructor binding specifies bytes as
its input parameter, so we have to convert it.
This commit is contained in:
anthony cantor 2013-08-27 16:05:29 -06:00 committed by Siu Kwan Lam
commit fea82991c3

View file

@ -129,6 +129,9 @@ class Disassembler(object):
@bs)
'''
if isinstance(bs, str):
bs = bytes(map(lambda c: ord(c), bs))
code = api.llvm.StringRefMemoryObject.new(bs, base_addr)
idx = 0
align = self.mai.getMinInstAlignment()