fixed pc relative offsets in arm. dang, even stackoverflow was wrong about this

This commit is contained in:
Ned Williamson 2016-01-24 21:10:06 -05:00
parent 89af06cb9a
commit 27f5e53f50
1 changed files with 6 additions and 2 deletions

View File

@ -480,8 +480,12 @@ class CsInsn(object):
raise IgnoredRegister(exp)
if exp in reginfo: #it's a register
if exp == "pc": #arm is so annoying sometimes
return reginfo[exp] + self.size()
#http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0552a/BABJJAAA.html
if exp == "pc": #arm is *so* annoying sometimes
val = reginfo[exp] + 4
if val & 2:
val -= 2
return val
return reginfo[exp]
#no exception here, ARM is explicit about constants