mirror of
https://github.com/holub/mame
synced 2025-06-09 14:22:41 +03:00
Avoid some unintended undefined behavior in devices/cpu/i386. Spotted by cppcheck (#3753)
* Avoid some unintended undefined behavior. Spotted by cppcheck * Some more undefined behavior caught by cppcheck (nw) * fixup (nw)
This commit is contained in:
parent
1383b14883
commit
b33867d92a
@ -318,7 +318,7 @@ void i386_device::i386_bsr_r32_rm32() // Opcode 0x0f bd
|
|||||||
} else {
|
} else {
|
||||||
m_ZF = 0;
|
m_ZF = 0;
|
||||||
dst = temp = 31;
|
dst = temp = 31;
|
||||||
while( (src & (1 << temp)) == 0 ) {
|
while( (src & (1U << temp)) == 0 ) {
|
||||||
temp--;
|
temp--;
|
||||||
dst = temp;
|
dst = temp;
|
||||||
CYCLES(CYCLES_BSR);
|
CYCLES(CYCLES_BSR);
|
||||||
|
@ -284,9 +284,9 @@ void i386_device::i486_group0F01_16() // Opcode 0x0f 01
|
|||||||
}
|
}
|
||||||
case 6: /* LMSW */
|
case 6: /* LMSW */
|
||||||
{
|
{
|
||||||
uint16_t b;
|
|
||||||
if(PROTECTED_MODE && m_CPL)
|
if(PROTECTED_MODE && m_CPL)
|
||||||
FAULT(FAULT_GP,0)
|
FAULT(FAULT_GP,0)
|
||||||
|
uint16_t b;
|
||||||
if( modrm >= 0xc0 ) {
|
if( modrm >= 0xc0 ) {
|
||||||
b = LOAD_RM16(modrm);
|
b = LOAD_RM16(modrm);
|
||||||
CYCLES(CYCLES_LMSW_REG);
|
CYCLES(CYCLES_LMSW_REG);
|
||||||
|
Loading…
Reference in New Issue
Block a user