瀏覽代碼

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;
             });
         }