From fc0788bc95c1f036ef3d831a0fbe61b83e7e36de Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 8 Apr 2015 11:31:12 -0700 Subject: [PATCH] Avoid unpredictable behavior in error condition. --- Core/MIPS/MIPSIntVFPU.cpp | 7 +++++++ Windows/Debugger/CtrlRegisterList.cpp | 1 + 2 files changed, 8 insertions(+) diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index e0948138d0..be321815db 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -390,7 +390,10 @@ namespace MIPSInt else if (type == 7) f[0] = Float16ToFloat32((u16)uimm16); // vfim else + { _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); + f[0] = 0; + } ApplyPrefixD(f, V_Single); V(vt) = f[0]; @@ -735,6 +738,8 @@ namespace MIPSInt break; default: _dbg_assert_msg_(CPU, 0, "Trying to interpret Int_Vf2h instruction that can't be interpreted"); + d[0] = 0; + d[1] = 0; break; } ApplyPrefixD(reinterpret_cast(d), outsize); @@ -1789,6 +1794,8 @@ bad: default: Reporting::ReportMessage("CrossQuat instruction with wrong size"); _dbg_assert_msg_(CPU,0,"Trying to interpret instruction that can't be interpreted"); + d[0] = 0; + d[1] = 0; break; } WriteVector(d, sz, vd); diff --git a/Windows/Debugger/CtrlRegisterList.cpp b/Windows/Debugger/CtrlRegisterList.cpp index c142b774ef..6f76773646 100644 --- a/Windows/Debugger/CtrlRegisterList.cpp +++ b/Windows/Debugger/CtrlRegisterList.cpp @@ -293,6 +293,7 @@ void CtrlRegisterList::onPaint(WPARAM wParam, LPARAM lParam) break; default: temp[0] = '\0'; + len = 0; break; }