summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2009-10-13 20:27:03 +0200
committerDavid Brownell <dbrownell@users.sourceforge.net>2009-10-13 15:33:04 -0700
commited1e45b3887f89655c2475f45149f6dad14c0e0c (patch)
tree6d7935fdeb28c81cc23189cec617141457fd7c4d /src
parent5535399a46deb2de685d743af1726c78720d8b84 (diff)
downloadopenocd+libswd-ed1e45b3887f89655c2475f45149f6dad14c0e0c.tar.gz
openocd+libswd-ed1e45b3887f89655c2475f45149f6dad14c0e0c.tar.bz2
openocd+libswd-ed1e45b3887f89655c2475f45149f6dad14c0e0c.tar.xz
openocd+libswd-ed1e45b3887f89655c2475f45149f6dad14c0e0c.zip
fix pass_condition() LE condition code check
The LE check is obviously buggy (as easily triggered during some testing), but I didn't audit the rest of the cases. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Diffstat (limited to 'src')
-rw-r--r--src/target/arm_simulator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/target/arm_simulator.c b/src/target/arm_simulator.c
index 7c610a5b..93fb3dd9 100644
--- a/src/target/arm_simulator.c
+++ b/src/target/arm_simulator.c
@@ -243,9 +243,9 @@ int pass_condition(uint32_t cpsr, uint32_t opcode)
else
return 0;
case 0xd: /* LE */
- if ((cpsr & 0x40000000) &&
- (((cpsr & 0x80000000) && !(cpsr & 0x10000000))
- || (!(cpsr & 0x80000000) && (cpsr & 0x10000000))))
+ if ((cpsr & 0x40000000) ||
+ ((cpsr & 0x80000000) && !(cpsr & 0x10000000))
+ || (!(cpsr & 0x80000000) && (cpsr & 0x10000000)))
return 1;
else
return 0;