mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-11 01:08:39 +12:00
Debugger: Fix SignedHex
It didnt take into account INTx_MIN. (UB for std::abs)
This commit is contained in:
parent
0bb3609cad
commit
552d8e6aec
1 changed files with 7 additions and 0 deletions
|
@ -61,6 +61,13 @@ protected:
|
||||||
static std::string SignedHex(T value)
|
static std::string SignedHex(T value)
|
||||||
{
|
{
|
||||||
const auto v = static_cast<std::make_signed_t<T>>(value);
|
const auto v = static_cast<std::make_signed_t<T>>(value);
|
||||||
|
|
||||||
|
if (v == std::numeric_limits<std::make_signed_t<T>>::min())
|
||||||
|
{
|
||||||
|
// for INTx_MIN
|
||||||
|
return fmt::format("-0x%x", v);
|
||||||
|
}
|
||||||
|
|
||||||
const auto av = std::abs(v);
|
const auto av = std::abs(v);
|
||||||
|
|
||||||
if (av < 10)
|
if (av < 10)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue