mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-02 02:06:46 +00:00
Do not call r_anal_cc_arg if we don't have cc info (#12150)
This commit is contained in:
parent
34a6cda6f8
commit
8d9591eeaf
@ -674,7 +674,7 @@ R_API void extract_rarg(RAnal *anal, RAnalOp *op, RAnalFunction *fcn, int *reg_s
|
||||
r_return_if_fail (anal && op && fcn);
|
||||
|
||||
if (!fcn->cc) {
|
||||
R_LOG_INFO ("No cc information for function at %" PFMT64x " to extract register arguments\n", fcn->addr);
|
||||
R_LOG_DEBUG ("No calling convention for function '%s' to extract register arguments\n", fcn->name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -669,7 +669,6 @@ R_API void r_core_anal_type_match(RCore *core, RAnalFunction *fcn) {
|
||||
|
||||
}
|
||||
}
|
||||
const char *place = r_anal_cc_arg (anal, fcn->cc, 1);
|
||||
// Type propgation for register based args
|
||||
RList *list = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_REG);
|
||||
RAnalVar *rvar, *bp_var;
|
||||
@ -707,21 +706,26 @@ R_API void r_core_anal_type_match(RCore *core, RAnalFunction *fcn) {
|
||||
free (type);
|
||||
r_anal_var_free (lvar);
|
||||
}
|
||||
r_list_free (list);
|
||||
// Type propgation from caller to callee function for stack based arguments
|
||||
if (place && !strncmp (place, "stack", 5)) {
|
||||
RList *list2 = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_BPV);
|
||||
r_list_foreach (list2, iter2, bp_var) {
|
||||
if (bp_var->isarg) {
|
||||
const char *query = sdb_fmt ("fcn.0x%08"PFMT64x".arg.%d", fcn->addr, (bp_var->delta - 8));
|
||||
char *type = (char *) sdb_const_get (anal->sdb_fcns, query, NULL);
|
||||
if (type) {
|
||||
var_retype (anal, bp_var, NULL, type, fcn->addr, false, false);
|
||||
if (fcn->cc) {
|
||||
const char *place = r_anal_cc_arg (anal, fcn->cc, 1);
|
||||
if (place && !strncmp (place, "stack", 5)) {
|
||||
RList *list2 = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_BPV);
|
||||
r_list_foreach (list2, iter2, bp_var) {
|
||||
if (bp_var->isarg) {
|
||||
const char *query = sdb_fmt ("fcn.0x%08" PFMT64x ".arg.%d", fcn->addr, (bp_var->delta - 8));
|
||||
char *type = (char *)sdb_const_get (anal->sdb_fcns, query, NULL);
|
||||
if (type) {
|
||||
var_retype (anal, bp_var, NULL, type, fcn->addr, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
r_list_free (list2);
|
||||
}
|
||||
r_list_free (list2);
|
||||
} else {
|
||||
R_LOG_DEBUG ("No calling convention set for function '%s'\n", fcn->name);
|
||||
}
|
||||
r_list_free (list);
|
||||
out_function:
|
||||
free (buf);
|
||||
r_cons_break_pop();
|
||||
|
@ -2721,7 +2721,7 @@ R_API int r_core_config_init(RCore *core) {
|
||||
// R2_LOGLEVEL / cfg.log.level
|
||||
p = r_sys_getenv ("R2_LOGLEVEL");
|
||||
SETICB ("cfg.log.level", p ? atoi(p) : R_DEFAULT_LOGLVL, cb_log_config_level, "Target log level/severity"\
|
||||
" (0:SILLY, 1:VERBOSE, 2:DEBUG, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)"
|
||||
" (0:SILLY, 1:DEBUG, 2:VERBOSE, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)"
|
||||
);
|
||||
free (p);
|
||||
// R2_LOGTRAP_LEVEL / cfg.log.traplevel
|
||||
|
Loading…
Reference in New Issue
Block a user