From d8aaa2f44caaba092a35987239a20f97dffac5b1 Mon Sep 17 00:00:00 2001 From: xorstream Date: Sat, 23 Jan 2016 12:44:12 +1100 Subject: [PATCH] Fixes to runtime arm mask checks --- qemu/target-arm/unicorn_arm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu/target-arm/unicorn_arm.c b/qemu/target-arm/unicorn_arm.c index 6e6417b6..c75c0244 100644 --- a/qemu/target-arm/unicorn_arm.c +++ b/qemu/target-arm/unicorn_arm.c @@ -42,7 +42,7 @@ int arm_reg_read(struct uc_struct *uc, unsigned int regid, void *value) mycpu = first_cpu; - if (uc->mode & ~UC_MODE_ARM_MASK) { + if (!(uc->mode & ~UC_MODE_ARM_MASK) { if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12) *(int32_t *)value = ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0]; else { @@ -78,7 +78,7 @@ int arm_reg_write(struct uc_struct *uc, unsigned int regid, const void *value) { CPUState *mycpu = first_cpu; - if (uc->mode & ~UC_MODE_ARM_MASK) { + if (!(uc->mode & ~UC_MODE_ARM_MASK) { if (regid >= UC_ARM_REG_R0 && regid <= UC_ARM_REG_R12) ARM_CPU(uc, mycpu)->env.regs[regid - UC_ARM_REG_R0] = *(uint32_t *)value; else {