Fix bug in emergency cxa pool free
This probably has never actually affected anyone in practice. The normal ABI implementation just uses malloc and only falls back to the pool on malloc failure. But if that happens a bunch of times the freelist gets out of order which violates some of the invariants of the freelist (as well as the comments that follow the bug). The bug is just a comparison reversal when traversing the freelist in the case where the pointer being returned to the pool is after the existing freelist. libstdc++-v3/ * libsupc++/eh_alloc.cc (pool::free): Inverse comparison.
This commit is contained in:
parent
3cab897a67
commit
5bc2042df4
1 changed files with 2 additions and 2 deletions
|
@ -224,8 +224,8 @@ namespace
|
|||
free_entry **fe;
|
||||
for (fe = &first_free_entry;
|
||||
(*fe)->next
|
||||
&& (reinterpret_cast <char *> ((*fe)->next)
|
||||
> reinterpret_cast <char *> (e) + sz);
|
||||
&& (reinterpret_cast <char *> (e) + sz
|
||||
> reinterpret_cast <char *> ((*fe)->next));
|
||||
fe = &(*fe)->next)
|
||||
;
|
||||
// If we can merge the next block into us do so and continue
|
||||
|
|
Loading…
Add table
Reference in a new issue