mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 07:57:49 +00:00
Fix null deref in contextSwitch().
This commit is contained in:
parent
2f99ff801e
commit
dd6706a1a1
1 changed files with 10 additions and 7 deletions
|
@ -360,14 +360,17 @@ static bool contextSwitch(Task* t)
|
||||||
if (current == t)
|
if (current == t)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// If the last task hasn't blocked (still marked as running),
|
if (current) {
|
||||||
// mark it as runnable for the next round.
|
// If the last task hasn't blocked (still marked as running),
|
||||||
if (current->state() == Task::Running)
|
// mark it as runnable for the next round.
|
||||||
current->setState(Task::Runnable);
|
if (current->state() == Task::Running)
|
||||||
|
current->setState(Task::Runnable);
|
||||||
|
|
||||||
bool success = MemoryManager::the().unmapRegionsForTask(*current);
|
bool success = MemoryManager::the().unmapRegionsForTask(*current);
|
||||||
ASSERT(success);
|
ASSERT(success);
|
||||||
success = MemoryManager::the().mapRegionsForTask(*t);
|
}
|
||||||
|
|
||||||
|
bool success = MemoryManager::the().mapRegionsForTask(*t);
|
||||||
ASSERT(success);
|
ASSERT(success);
|
||||||
|
|
||||||
current = t;
|
current = t;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue