mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Debugger: Fixed crash when trying to use the "Edit selected code" on a block start/end header
This commit is contained in:
parent
797ef1f57a
commit
a574032c8f
2 changed files with 8 additions and 2 deletions
|
@ -97,7 +97,9 @@ namespace Mesen.Debugger.ViewModels
|
|||
StartAddress = address;
|
||||
Code = code;
|
||||
|
||||
_originalCode = DebugApi.GetMemoryValues(CpuType.ToMemoryType(), (uint)StartAddress, (uint)(StartAddress + OriginalByteCount - 1));
|
||||
if(OriginalByteCount > 0) {
|
||||
_originalCode = DebugApi.GetMemoryValues(CpuType.ToMemoryType(), (uint)StartAddress, (uint)(StartAddress + OriginalByteCount - 1));
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAssembly(string code)
|
||||
|
|
|
@ -393,7 +393,11 @@ namespace Mesen.Debugger.ViewModels
|
|||
}
|
||||
} while(i < SelectionEnd);
|
||||
|
||||
byteCount = endAddress - SelectionStart + 1;
|
||||
if(SelectionStart <= endAddress) {
|
||||
byteCount = endAddress - SelectionStart + 1;
|
||||
} else {
|
||||
byteCount = 0;
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue