diff options
author | Thomas Jarosch <tomj@simonv.com> | 2015-01-12 19:33:46 +0100 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2015-01-12 19:36:58 +0100 |
commit | 789df17dd9f5f6f940ffc1b1db11c4e777400767 (patch) | |
tree | 70ff4b21e5bb917f3b99f20efd96994bc247a05a /lib/unwarminder/unwarm_thumb.c | |
parent | 799024198f196b71b3afed402bbd7c4ccc4c23b4 (diff) | |
download | rockbox-789df17dd9f5f6f940ffc1b1db11c4e777400767.tar.gz rockbox-789df17dd9f5f6f940ffc1b1db11c4e777400767.zip |
ARM unwinder for thumb: Fix broken MOV opcode
The origin of the register value was never
moved in the desired register state due to a typo ('rhs' vs. 'rhd').
While looking at the code, I noticed the action taken
for the register value is another copy'n'paste error
from the ADD opcode above -> it added to the register value
instead of MOVing the current value.
Patch submitted upstream.
cppcheck reported:
[lib/unwarminder/unwarm_thumb.c:473]: (warning) Redundant assignment of 'state.regData[rhd].o' to itself.
Change-Id: I78cdbf37a191007a3bddbaa350b906dbce2fe671
Diffstat (limited to 'lib/unwarminder/unwarm_thumb.c')
-rw-r--r-- | lib/unwarminder/unwarm_thumb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/unwarminder/unwarm_thumb.c b/lib/unwarminder/unwarm_thumb.c index b71d9732b1..bd0175c9cf 100644 --- a/lib/unwarminder/unwarm_thumb.c +++ b/lib/unwarminder/unwarm_thumb.c | |||
@@ -469,8 +469,8 @@ UnwResult UnwStartThumb(UnwState * const state) | |||
469 | case 2: /* MOV */ | 469 | case 2: /* MOV */ |
470 | UnwPrintd5("MOV r%d, r%d\t; r%d %s", | 470 | UnwPrintd5("MOV r%d, r%d\t; r%d %s", |
471 | rhd, rhs, rhd, M_Origin2Str(state->regData[rhs].o)); | 471 | rhd, rhs, rhd, M_Origin2Str(state->regData[rhs].o)); |
472 | state->regData[rhd].v += state->regData[rhs].v; | 472 | state->regData[rhd].v = state->regData[rhs].v; |
473 | state->regData[rhd].o = state->regData[rhd].o; | 473 | state->regData[rhd].o = state->regData[rhs].o; |
474 | break; | 474 | break; |
475 | 475 | ||
476 | case 3: /* BX */ | 476 | case 3: /* BX */ |