From 33882a2e159b45f6a38d265a7d8c91ee5b6a3e49 Mon Sep 17 00:00:00 2001 From: wargio Date: Sun, 7 Jan 2024 20:04:06 +0800 Subject: [PATCH] small refactoring --- src/core/Cutter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/Cutter.cpp b/src/core/Cutter.cpp index c87404f0..cab4f2e5 100644 --- a/src/core/Cutter.cpp +++ b/src/core/Cutter.cpp @@ -3188,13 +3188,13 @@ QList CutterCore::getAllExports() QList CutterCore::getAllSymbols() { CORE_LOCK(); - QList ret; - - if (!(core && core->bin && core->bin->cur && core->bin->cur->o)) { + RzBinFile *bf = rz_bin_cur(core->bin); + if (!bf) { return {}; } - const RzPVector *symbols = rz_bin_object_get_symbols(core->bin->cur->o); + QList ret; + const RzPVector *symbols = rz_bin_object_get_symbols(bf->o); if (symbols) { for (const auto &bs : CutterPVector(symbols)) { QString type = QString(bs->bind) + " " + QString(bs->type); @@ -3207,7 +3207,7 @@ QList CutterCore::getAllSymbols() } } - const RzList *entries = rz_bin_object_get_entries(core->bin->cur->o); + const RzList *entries = rz_bin_object_get_entries(bf->o); if (entries) { /* list entrypoints as symbols too */ int n = 0;