cpu-exec: Resolve potential compilation errors

We need to pass 'uc' to CPU_GET_CLASS
This commit is contained in:
Lioncash 2018-03-12 14:58:03 -04:00
parent e9d9ed5eaa
commit 56675f5215
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -315,7 +315,7 @@ static inline bool cpu_handle_exception(struct uc_struct *uc, CPUState *cpu, int
which will be handled outside the cpu execution which will be handled outside the cpu execution
loop */ loop */
#if defined(TARGET_I386) #if defined(TARGET_I386)
CPUClass *cc = CPU_GET_CLASS(cpu); CPUClass *cc = CPU_GET_CLASS(uc, cpu);
cc->do_interrupt(cpu); cc->do_interrupt(cpu);
#endif #endif
*ret = cpu->exception_index; *ret = cpu->exception_index;
@ -543,8 +543,8 @@ int cpu_exec(struct uc_struct *uc, CPUState *cpu)
cc = CPU_GET_CLASS(uc, cpu); cc = CPU_GET_CLASS(uc, cpu);
#else /* buggy compiler */ #else /* buggy compiler */
/* Assert that the compiler does not smash local variables. */ /* Assert that the compiler does not smash local variables. */
g_assert(cpu == current_cpu); g_assert(cpu == uc->current_cpu);
g_assert(cc == CPU_GET_CLASS(cpu)); g_assert(cc == CPU_GET_CLASS(uc, cpu));
#endif /* buggy compiler */ #endif /* buggy compiler */
cpu->can_do_io = 1; cpu->can_do_io = 1;
// Unicorn: commented out // Unicorn: commented out