Fix mips identification via RArchConfig instead of RAsm

This commit is contained in:
pancake 2022-07-07 19:16:22 +02:00
parent 8939854b8c
commit 34b21efc1e
2 changed files with 6 additions and 5 deletions

View File

@ -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)) {

View File

@ -90,7 +90,7 @@ RUN
NAME=assembler
FILE=-
CMDS=<<EOF
e asm.arch=mips.gnu
e asm.arch=mips
e asm.bits=32
e cfg.bigendian=0
pa lui t9, 0x41
@ -112,7 +112,7 @@ RUN
NAME=with-spaces
FILE=-
CMDS=<<EOF
e asm.arch=mips.gnu
e asm.arch=mips
e asm.bits=32
e cfg.bigendian=0
pa addiu v0, v1, 33