Skip to content

Commit

Permalink
Fix arch selection when loading no files -- with r2 -a -- ##tools
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed May 27, 2024
1 parent f7c0e05 commit 70c0646
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libr/main/radare2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1703,6 +1703,15 @@ R_API int r_main_radare2(int argc, const char **argv) {
free (f);
}
} else {
if (mr.asmarch) {
r_config_set (r->config, "asm.arch", mr.asmarch);
}
if (mr.asmbits) {
r_config_set (r->config, "asm.bits", mr.asmbits);
}
if (mr.asmos) {
r_config_set (r->config, "asm.os", mr.asmos);
}
r_core_block_read (r);
}
{
Expand Down
26 changes: 26 additions & 0 deletions test/db/cmd/bug_arch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
NAME=-a bug
FILE=--
ARGS=-a ppc -b32
CMDS=<<EOF
-a
-b
EOF
EXPECT=<<EOF
ppc
32
EOF
RUN

NAME=-a bug
FILE=-
ARGS=-a ppc -b32
CMDS=<<EOF
-a
-b
EOF
EXPECT=<<EOF
ppc
32
EOF
RUN

0 comments on commit 70c0646

Please sign in to comment.