mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Fix segfault in EditFunctionMenu (#868)
This commit is contained in:
parent
f0fc9fc5e3
commit
528adf429a
@ -267,8 +267,6 @@ void DisassemblyContextMenu::aboutToShowSlot()
|
||||
actionAnalyzeFunction.setVisible(false);
|
||||
actionRename.setVisible(true);
|
||||
actionRename.setText(tr("Rename function \"%1\"").arg(fcn->name));
|
||||
actionEditFunction.setVisible(true);
|
||||
actionEditFunction.setText(tr("Edit function \"%1\"").arg(fcn->name));
|
||||
} else if (f) {
|
||||
actionRename.setVisible(true);
|
||||
actionRename.setText(tr("Rename flag \"%1\"").arg(f->name));
|
||||
@ -280,10 +278,13 @@ void DisassemblyContextMenu::aboutToShowSlot()
|
||||
if(in_fcn)
|
||||
{
|
||||
actionSetFunctionVarTypes.setVisible(true);
|
||||
actionEditFunction.setVisible(true);
|
||||
actionEditFunction.setText(tr("Edit function \"%1\"").arg(in_fcn->name));
|
||||
}
|
||||
else
|
||||
{
|
||||
actionSetFunctionVarTypes.setVisible(false);
|
||||
actionEditFunction.setVisible(false);
|
||||
}
|
||||
|
||||
|
||||
@ -693,8 +694,9 @@ void DisassemblyContextMenu::on_actionEditFunction_triggered()
|
||||
{
|
||||
RCore *core = Core()->core();
|
||||
EditFunctionDialog *dialog = new EditFunctionDialog(this);
|
||||
RAnalFunction *fcn = r_anal_get_fcn_at (core->anal, offset, R_ANAL_FCN_TYPE_NULL);
|
||||
RAnalFunction *fcn = r_anal_get_fcn_in(core->anal, offset, 0);
|
||||
|
||||
if (fcn) {
|
||||
dialog->setWindowTitle(tr("Edit function %1").arg(fcn->name));
|
||||
dialog->setNameText(fcn->name);
|
||||
|
||||
@ -726,6 +728,7 @@ void DisassemblyContextMenu::on_actionEditFunction_triggered()
|
||||
Core()->cmd("afc " + dialog->getCallConSelected());
|
||||
emit Core()->functionsChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::setBase(QString base)
|
||||
|
Loading…
Reference in New Issue
Block a user