File tree 2 files changed +19
-4
lines changed
2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -271,8 +271,10 @@ class HeadIterator {
271
271
/* *
272
272
* Retrieve the next chunk address if any are found
273
273
* @param address Address to start from
274
+ * @param skip_current Do not consider the chunk starting at the current
275
+ * address
274
276
*/
275
- void SetNextChunk (ea_t address);
277
+ void SetNextChunk (ea_t address, bool skip_current = true );
276
278
277
279
/* *
278
280
* Compute the next address and state
Original file line number Diff line number Diff line change @@ -61,11 +61,24 @@ void HeadIterator::InitAddresses(ea_t address) {
61
61
this ->next_unk_addr = next_unknown (address, this ->max_ea );
62
62
this ->next_head_addr = next_head (address, this ->max_ea );
63
63
64
- this ->SetNextChunk (address);
64
+ this ->SetNextChunk (address, false );
65
65
}
66
66
67
- void HeadIterator::SetNextChunk (ea_t address) {
68
- func_t * func = get_next_fchunk (address);
67
+ void HeadIterator::SetNextChunk (ea_t address, bool skip_current /* = true*/ ) {
68
+ func_t * func;
69
+
70
+ // Check if there is a chunk starting at provided address
71
+ if (!skip_current) {
72
+ func = get_fchunk (address);
73
+ if (func != nullptr && func->start_ea == address) {
74
+ this ->next_chunk_addr = address;
75
+ this ->next_func_chunk = func;
76
+ return ;
77
+ }
78
+ }
79
+
80
+ // Find the next chunk, not considering the one at the current address
81
+ func = get_next_fchunk (address);
69
82
if (func != nullptr ) {
70
83
this ->next_chunk_addr = func->start_ea ;
71
84
this ->next_func_chunk = func;
You can’t perform that action at this time.
0 commit comments