target-arm: Fix arm_excp_unmasked() function

There is an error in arm_excp_unmasked() function:
bitwise operator & is used with integer and bool operands
causing an incorrect zeroed result.
The patch fixes it.

Backports commit 771842585f3119f69641ed90a97d56eb9ed6f5ae from qemu
This commit is contained in:
Sergey Sorokin 2018-02-15 11:03:25 -05:00 committed by Lioncash
parent 5b40cb8562
commit 02ace69c9d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -1535,8 +1535,8 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx,
CPUARMState *env = cs->env_ptr;
unsigned int cur_el = arm_current_el(env);
bool secure = arm_is_secure(env);
uint32_t scr;
uint32_t hcr;
bool scr;
bool hcr;
bool pstate_unmasked;
int8_t unmasked = 0;
@ -1563,7 +1563,7 @@ static inline bool arm_excp_unmasked(CPUState *cs, unsigned int excp_idx,
* set then FIQs can be masked by CPSR.F when non-secure but only
* when FIQs are only routed to EL3.
*/
scr &= !((env->cp15.scr_el3 & SCR_FW) && !hcr);
scr = scr && !((env->cp15.scr_el3 & SCR_FW) && !hcr);
pstate_unmasked = !(env->daif & PSTATE_F);
break;
case EXCP_IRQ: