Fix CheckPtr and CheckCodePtr missing else and return.

This commit is contained in:
TomAwezome 2022-10-26 19:26:54 -04:00
parent 1d74c8116e
commit 422414aa87

View file

@ -1,13 +1,21 @@
Bool CheckPtr(U8 *ptr)
{//Check if address is valid pointer.
CZXE *zxe = mem_boot_base - sizeof(CZXE);
if (mem_heap_base <= ptr <= mem_mapped_space)
return *MemPageTable(ptr) & 1;
else
return mem_boot_base < ptr < mem_boot_base + zxe->file_size - 1 - sizeof(CZXE);
}
Bool CheckCodePtr(U8 *ptr)
{//Check if address is valid code address.
CZXE *zxe = mem_boot_base - sizeof(CZXE);
if (mem_heap_base <= ptr <= mem_heap_limit)
return *MemPageTable(ptr) & 1;
else
return mem_boot_base < ptr < mem_boot_base + zxe->file_size - 1 - sizeof(CZXE);
}
Bool CheckOnStack(U8 *ptr, CTask *task=NULL)