unicorn/arm: use uc->cpu instead of uc->current_cpu

Keeps cpu variable usage consistent. Also eliminates unnecessary casts
This commit is contained in:
Lioncash 2018-03-07 10:15:44 -05:00
parent 890f234a53
commit d0abc23e99
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 7 additions and 3 deletions

View file

@ -14,7 +14,9 @@ const int ARM64_REGS_STORAGE_SIZE = offsetof(CPUARMState, tlb_table);
static void arm64_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUARMState *)uc->current_cpu->env_ptr)->pc = address;
CPUArchState *state = uc->cpu->env_ptr;
state->pc = address;
}
void arm64_release(void* ctx);

View file

@ -14,8 +14,10 @@ const int ARM_REGS_STORAGE_SIZE = offsetof(CPUARMState, tlb_table);
static void arm_set_pc(struct uc_struct *uc, uint64_t address)
{
((CPUARMState *)uc->current_cpu->env_ptr)->pc = address;
((CPUARMState *)uc->current_cpu->env_ptr)->regs[15] = address;
CPUArchState *state = uc->cpu->env_ptr;
state->pc = address;
state->regs[15] = address;
}
void arm_release(void* ctx);