This commit is contained in:
Alvaro Muñoz 2014-12-20 14:30:08 +01:00 committed by pancake
parent d6c46d4f55
commit 1763def25f

View File

@ -351,6 +351,7 @@ static int is_hit_inrange(RCoreAsmHit *hit, ut64 start_range, ut64 end_range){
R_API RList *r_core_asm_bwdisassemble (RCore *core, ut64 addr, int n, int len) {
RList *hits = r_core_asm_hit_list_new();
int buflen = len;
RCoreAsmHit dummy_value;
RAsmOp op;
ut8 *buf = (ut8 *)malloc (len);
@ -397,6 +398,18 @@ R_API RList *r_core_asm_bwdisassemble (RCore *core, ut64 addr, int n, int len) {
}
}
if (hit_count >= n) break;
if (idx == len-1) {
len += buflen;
if (!(buf = realloc (buf, len))) {
if (hits) {
r_list_purge (hits);
free (hits);
}
free (buf);
return NULL;
}
}
}
if (hit_count == n) {