L4Re/OLD/libfsserver

Changeset

216:f2f123627288
2020-08-05 Paul Boddie raw files shortlog changelog graph When purging flexpages, make sure that the positions are also purged. This was the source of various address exceptions.
include/fsserver/pages.h (file)
     1.1 --- a/include/fsserver/pages.h	Wed Aug 05 01:30:04 2020 +0200
     1.2 +++ b/include/fsserver/pages.h	Wed Aug 05 01:31:40 2020 +0200
     1.3 @@ -188,8 +188,24 @@
     1.4        if (current->first != accessor)
     1.5          continue;
     1.6  
     1.7 +      /* Insert a new queue entry for the flexpage to replace the existing
     1.8 +         one. */
     1.9 +
    1.10 +      Flexpage_queue::iterator repl = _queue.insert(it, Flexpage_queue_item(NULL, current->second));
    1.11 +
    1.12 +      /* Find the position of the queue entry and remove it from the mapping. */
    1.13 +
    1.14 +      Flexpage_positions::iterator item = _positions.find(current->second);
    1.15 +
    1.16 +      if (item != _positions.end())
    1.17 +      {
    1.18 +        _positions.erase(item);
    1.19 +        _positions.insert(Flexpage_position_item(current->second, repl));
    1.20 +      }
    1.21 +
    1.22 +      /* Erase the existing queue entry, leaving a null replacement. */
    1.23 +
    1.24        _queue.erase(current);
    1.25 -      _queue.insert(it, Flexpage_queue_item(NULL, current->second));
    1.26      }
    1.27  
    1.28      unlock_queue();