From 34b21efc1e80646d4f2c4a1da71cfb82f3063e3f Mon Sep 17 00:00:00 2001 From: pancake Date: Thu, 7 Jul 2022 19:16:22 +0200 Subject: [PATCH] Fix mips identification via RArchConfig instead of RAsm --- libr/core/cfile.c | 7 ++++--- test/db/anal/mips | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libr/core/cfile.c b/libr/core/cfile.c index ded697315d..dfcf9d88ae 100644 --- a/libr/core/cfile.c +++ b/libr/core/cfile.c @@ -28,12 +28,13 @@ R_API bool r_core_file_close_all_but(RCore *core) { return true; } -static bool __isMips(RAsm *a) { - return a && a->cur && a->cur->arch && strstr (a->cur->arch, "mips"); +static bool its_a_mips(RCore *core) { + RArchConfig *cfg = core->rasm->config; + return cfg && cfg->arch && !strcmp (cfg->arch, "mips"); } static void loadGP(RCore *core) { - if (__isMips (core->rasm)) { + if (its_a_mips (core)) { ut64 e0 = r_num_math (core->num, "entry0"); ut64 gp = r_num_math (core->num, "loc._gp"); if ((!gp || gp == UT64_MAX) && (e0 && e0 != UT64_MAX)) { diff --git a/test/db/anal/mips b/test/db/anal/mips index d0d813c36b..e0a542187b 100644 --- a/test/db/anal/mips +++ b/test/db/anal/mips @@ -90,7 +90,7 @@ RUN NAME=assembler FILE=- CMDS=<