Refactor stack growth code to remove messy conditions
This commit is contained in:
@@ -13,15 +13,7 @@ static bool grow_stack (const void *addr);
|
|||||||
bool
|
bool
|
||||||
try_alloc_new_page (const void *ptr, const void *esp)
|
try_alloc_new_page (const void *ptr, const void *esp)
|
||||||
{
|
{
|
||||||
if (needs_new_page (ptr, esp))
|
return needs_new_page (ptr, esp) && grow_stack (ptr);
|
||||||
{
|
|
||||||
if (!grow_stack (ptr))
|
|
||||||
return 0;
|
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Validates a given address for being a stack query and not a generic erroneous
|
/* Validates a given address for being a stack query and not a generic erroneous
|
||||||
|
|||||||
Reference in New Issue
Block a user