Преглед изворни кода

Kernel: Fix bad VMObject iteration in sys$purge()

We were fooling ourselves into thinking all VMObjects are anonymous and
then tried to call purge() on them as if they were.
Andreas Kling пре 4 година
родитељ
комит
9ec9d20e84
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      Kernel/Syscalls/purge.cpp

+ 2 - 1
Kernel/Syscalls/purge.cpp

@@ -43,7 +43,8 @@ int Process::sys$purge(int mode)
         {
             InterruptDisabler disabler;
             MM.for_each_vmobject([&](auto& vmobject) {
-                vmobjects.append(vmobject);
+                if (vmobject.is_anonymous())
+                    vmobjects.append(vmobject);
                 return IterationDecision::Continue;
             });
         }