Skip to content

Commit

Permalink
keep asm.cpu when valid in cb_asmarch
Browse files Browse the repository at this point in the history
  • Loading branch information
imbillow committed Nov 5, 2024
1 parent 96cbff4 commit e3eada2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions librz/core/cconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,19 +514,21 @@ static bool cb_asmarch(void *user, void *data) {
RzConfigNode *asm_cpu_node = rz_config_node_get(core->config, "asm.cpu");
if (core->rasm->cur) {
const char *cpus = core->rasm->cur->cpus;
if (RZ_STR_ISNOTEMPTY(cpus)) {
char *cpu0 = rz_str_dup(cpus);
char *comma = strchr(cpu0, ',');
if (comma) {
*comma = 0;
}
if (strstr(cpus, asm_cpu_node->value) == NULL) {
if (RZ_STR_ISNOTEMPTY(cpus)) {
char *cpu0 = rz_str_dup(cpus);
char *comma = strchr(cpu0, ',');
if (comma) {
*comma = 0;
}

if (!*asm_cpu_node->value || (*asm_cpu_node->value && RZ_STR_NE(cpu0, asm_cpu_node->value))) {
rz_config_set(core->config, "asm.cpu", cpu0);
if (!*asm_cpu_node->value || (*asm_cpu_node->value && RZ_STR_NE(cpu0, asm_cpu_node->value))) {
rz_config_set(core->config, "asm.cpu", cpu0);
}
free(cpu0);
} else {
rz_config_set(core->config, "asm.cpu", "");
}
free(cpu0);
} else {
rz_config_set(core->config, "asm.cpu", "");
}

bits = core->rasm->cur->bits;
Expand Down

0 comments on commit e3eada2

Please sign in to comment.