Revert changes in functionAt (#2941)

This commit is contained in:
Paul I 2022-05-12 17:55:55 +03:00 committed by GitHub
parent bdeacabffb
commit 5f376f55db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View File

@ -1266,16 +1266,7 @@ RzAnalysisFunction *CutterCore::functionIn(ut64 addr)
RzAnalysisFunction *CutterCore::functionAt(ut64 addr) RzAnalysisFunction *CutterCore::functionAt(ut64 addr)
{ {
CORE_LOCK(); CORE_LOCK();
RzAnalysisFunction *fcn = rz_analysis_get_function_at(core->analysis, addr); return rz_analysis_get_function_at(core->analysis, addr);
if (fcn) {
return fcn;
}
RzList *list = rz_analysis_get_functions_in(core->analysis, addr);
if (rz_list_length(list) == 1) {
fcn = static_cast<RzAnalysisFunction *>(rz_list_first(list));
}
rz_list_free(list);
return fcn;
} }
/** /**

View File

@ -84,7 +84,7 @@ QString GraphWidget::getWidgetType()
void GraphWidget::prepareHeader() void GraphWidget::prepareHeader()
{ {
RzAnalysisFunction *f = Core()->functionAt(seekable->getOffset()); RzAnalysisFunction *f = Core()->functionIn(seekable->getOffset());
char *str = f ? rz_analysis_function_get_signature(f) : nullptr; char *str = f ? rz_analysis_function_get_signature(f) : nullptr;
if (!str) { if (!str) {
header->hide(); header->hide();