Skip to content

Commit

Permalink
Fix #5898 (#6607)
Browse files Browse the repository at this point in the history
Not reloading sdb_types if editing env_vars results no change
  • Loading branch information
oddcoder committed Jan 29, 2017
1 parent 257ff5c commit df54bf1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libr/anal/anal.c
Expand Up @@ -149,6 +149,8 @@ R_API void r_anal_list(RAnal *anal) {
R_API bool r_anal_use(RAnal *anal, const char *name) {
RListIter *it;
RAnalPlugin *h;

bool change = anal && anal->cur && strcmp (anal->cur->name, name);
r_list_foreach (anal->plugins, it, h) {
if (!strcmp (h->name, name)) {
#if 0
Expand All @@ -159,7 +161,9 @@ R_API bool r_anal_use(RAnal *anal, const char *name) {
#endif
anal->cur = h;
r_anal_set_reg_profile (anal);
r_anal_set_fcnsign (anal, NULL);
if (change) {
r_anal_set_fcnsign (anal, NULL);
}
if (anal->esil) {
r_anal_esil_free (anal->esil);
anal->esil = NULL;
Expand Down
8 changes: 7 additions & 1 deletion libr/core/cconfig.c
Expand Up @@ -355,7 +355,13 @@ static int cb_asmarch(void *user, void *data) {
r_asm_set_cpu (core->assembler, asm_cpu);
free (asm_cpu);
/* reload types and cc info */
r_core_anal_type_init (core);
// changing asm.arch changes anal.arch
// changing anal.arch sets types db
// so ressetting is redundant and may lead to bugs
// 1 case this is usefull is when sdb_types is null
if (!core->anal->sdb_types) {
r_core_anal_type_init (core);
}
r_core_anal_cc_init (core);
return true;
}
Expand Down

0 comments on commit df54bf1

Please sign in to comment.