Skip to content

Commit

Permalink
Revert check for a set stackptr.
Browse files Browse the repository at this point in the history
stackptr is used in different ways:
1. Safes the offset from the stack frame base.
2. Is interpreted as somthing else for x86 and I cannot find out what, in a reasonably time.

Hence we cannot use it here consistently.
  • Loading branch information
Rot127 committed Dec 16, 2023
1 parent efd6137 commit caa08d3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions librz/analysis/var.c
Original file line number Diff line number Diff line change
Expand Up @@ -1178,12 +1178,7 @@ static void extract_stack_var(RzAnalysis *analysis, RzAnalysisFunction *fcn, RzA

RzStackAddr stack_off;
if (is_sp) {
if (op->stackptr != RZ_ANALYSIS_OP_INVALID_STACKPTR) {
// If the stackptr is set we assume it is more correct and use it here.
stack_off = op->stackptr;
} else {
stack_off = addend - fcn->stack;
}
stack_off = addend - fcn->stack;
} else {
stack_off = addend - fcn->bp_off;
}
Expand Down

0 comments on commit caa08d3

Please sign in to comment.