mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 02:48:49 +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()) {
|
if (dialog.exec()) {
|
||||||
QString new_name = dialog.getNameText();
|
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();
|
QString new_start_addr = dialog.getStartAddrText();
|
||||||
fcn->addr = Core()->math(new_start_addr);
|
fcn->addr = Core()->math(new_start_addr);
|
||||||
QString new_stack_size = dialog.getStackSizeText();
|
QString new_stack_size = dialog.getStackSizeText();
|
||||||
fcn->stack = int(Core()->math(new_stack_size));
|
fcn->stack = int(Core()->math(new_stack_size));
|
||||||
|
|
||||||
const char *ccSelected = dialog.getCallConSelected().toUtf8().constData();
|
QByteArray newCC = dialog.getCallConSelected().toUtf8();
|
||||||
if (RZ_STR_ISEMPTY(ccSelected)) {
|
if (!newCC.isEmpty() && rz_analysis_cc_exist(core->analysis, newCC.constData())) {
|
||||||
return;
|
fcn->cc = rz_str_constpool_get(&core->analysis->constpool, newCC.constData());
|
||||||
}
|
|
||||||
if (rz_analysis_cc_exist(core->analysis, ccSelected)) {
|
|
||||||
fcn->cc = rz_str_constpool_get(&core->analysis->constpool, ccSelected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emit Core()->functionsChanged();
|
emit Core()->functionsChanged();
|
||||||
|
Loading…
Reference in New Issue
Block a user