Merge pull request #114 from matthew-cline/TOPIC-vector-fix

mightBeVec() fix
develop
Petr Mrázek 2011-07-21 02:27:51 -07:00
commit 2e40319e40
1 changed files with 4 additions and 1 deletions

@ -71,7 +71,10 @@ static bool mightBeVec(vector<t_memrange> &heap_ranges,
if ((vec->start > vec->end) || (vec->end > vec->alloc_end))
return false;
if ((vec->end - vec->start) % 4 != 0)
// Vector length might not be a multiple of 4 if, for example,
// it's a vector of uint8_t or uint16_t. However, the actual memory
// allocated to the vector should be 4 byte aligned.
if ((vec->start % 4 != 0) || (vec->alloc_end % 4 != 0))
return false;
for (size_t i = 0; i < heap_ranges.size(); i++)