mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-18 18:38:51 +00:00
Fix changing the CC of a function (#3067)
The QByteArray must be kept alive as long as its contens are used. Also in this function, Core()->renameFunction() is not used to avoid sending multiple signals for a single edit action.
This commit is contained in:
parent
2d7fd02a62
commit
ad82407c2c
@ -1023,18 +1023,15 @@ void DisassemblyContextMenu::on_actionEditFunction_triggered()
|
||||
|
||||
if (dialog.exec()) {
|
||||
QString new_name = dialog.getNameText();
|
||||
Core()->renameFunction(fcn->addr, new_name);
|
||||
rz_core_analysis_function_rename(core, fcn->addr, new_name.toStdString().c_str());
|
||||
QString new_start_addr = dialog.getStartAddrText();
|
||||
fcn->addr = Core()->math(new_start_addr);
|
||||
QString new_stack_size = dialog.getStackSizeText();
|
||||
fcn->stack = int(Core()->math(new_stack_size));
|
||||
|
||||
const char *ccSelected = dialog.getCallConSelected().toUtf8().constData();
|
||||
if (RZ_STR_ISEMPTY(ccSelected)) {
|
||||
return;
|
||||
}
|
||||
if (rz_analysis_cc_exist(core->analysis, ccSelected)) {
|
||||
fcn->cc = rz_str_constpool_get(&core->analysis->constpool, ccSelected);
|
||||
QByteArray newCC = dialog.getCallConSelected().toUtf8();
|
||||
if (!newCC.isEmpty() && rz_analysis_cc_exist(core->analysis, newCC.constData())) {
|
||||
fcn->cc = rz_str_constpool_get(&core->analysis->constpool, newCC.constData());
|
||||
}
|
||||
|
||||
emit Core()->functionsChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user