Explorar o código

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 %!s(int64=4) %!d(string=hai) anos
pai
achega
9ec9d20e84
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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;
             });
         }