mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix left shift of negative value in MIPSCodeUtils
Fixes a benign UBSAN error to improve the signal-to-noise ratio of UBSAN errors. Fixes #14015
This commit is contained in:
parent
c251d69eab
commit
c17685646e
1 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@ namespace MIPSCodeUtils
|
|||
MIPSInfo info = MIPSGetInfo(op);
|
||||
if (info & IS_CONDBRANCH)
|
||||
{
|
||||
return addr + 4 + ((signed short)(op&0xFFFF)<<2);
|
||||
return addr + 4 + ((signed short)((op&0xFFFF)<<2));
|
||||
}
|
||||
else
|
||||
return INVALIDTARGET;
|
||||
|
@ -77,7 +77,7 @@ namespace MIPSCodeUtils
|
|||
MIPSInfo info = MIPSGetInfo(op);
|
||||
if ((info & IS_CONDBRANCH) && !(info & OUT_RA))
|
||||
{
|
||||
return addr + 4 + ((signed short)(op&0xFFFF)<<2);
|
||||
return addr + 4 + ((signed short)((op&0xFFFF)<<2));
|
||||
}
|
||||
else
|
||||
return INVALIDTARGET;
|
||||
|
@ -125,7 +125,7 @@ namespace MIPSCodeUtils
|
|||
}
|
||||
|
||||
if (sure && takeBranch)
|
||||
return addr + 4 + ((signed short)(op&0xFFFF)<<2);
|
||||
return addr + 4 + ((signed short)((op&0xFFFF)<<2));
|
||||
else if (sure && !takeBranch)
|
||||
return addr + 8;
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue