Debugger: Prevent saving a -1 sized func.

This commit is contained in:
Unknown W. Brackets 2019-03-24 12:56:23 -07:00
parent 737be61f9a
commit f53ea7e44f

View file

@ -979,8 +979,8 @@ void CtrlDisAsmView::onMouseUp(WPARAM wParam, LPARAM lParam, int button)
std::string newname;
truncate_cpy(name, g_symbolMap->GetLabelString(funcBegin).c_str());
if (InputBox_GetString(MainWindow::GetHInstance(), MainWindow::GetHWND(), L"New function name", name, newname)) {
g_symbolMap->SetLabelName(newname.c_str(),funcBegin);
u32 funcSize = g_symbolMap->GetFunctionSize(curAddress);
g_symbolMap->SetLabelName(newname.c_str(), funcBegin);
u32 funcSize = g_symbolMap->GetFunctionSize(funcBegin);
MIPSAnalyst::RegisterFunction(funcBegin, funcSize, newname.c_str());
MIPSAnalyst::UpdateHashMap();
MIPSAnalyst::ApplyHashMap();