mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[NTOSKRNL] Add ASSERTs to make sure, we never use an uninitialized variable
This commit is contained in:
parent
d385122f1e
commit
c66b66656b
1 changed files with 9 additions and 3 deletions
|
@ -601,7 +601,7 @@ MiFindEmptyAddressRangeDownTree(IN SIZE_T Length,
|
||||||
OUT PULONG_PTR Base,
|
OUT PULONG_PTR Base,
|
||||||
OUT PMMADDRESS_NODE *Parent)
|
OUT PMMADDRESS_NODE *Parent)
|
||||||
{
|
{
|
||||||
PMMADDRESS_NODE Node, OldNode, Child;
|
PMMADDRESS_NODE Node, OldNode = NULL, Child;
|
||||||
ULONG_PTR LowVpn, HighVpn, AlignmentVpn;
|
ULONG_PTR LowVpn, HighVpn, AlignmentVpn;
|
||||||
PFN_NUMBER PageCount;
|
PFN_NUMBER PageCount;
|
||||||
|
|
||||||
|
@ -670,8 +670,14 @@ MiFindEmptyAddressRangeDownTree(IN SIZE_T Length,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Node has a right child, the node we had before is the most
|
/* Node has a right child. This means we must have already
|
||||||
left grandchild of that right child, use it as parent. */
|
moved one node left from the right-most node we started
|
||||||
|
with, thus we already have an OldNode! */
|
||||||
|
ASSERT(OldNode != NULL);
|
||||||
|
|
||||||
|
/* The node we had before is the most left grandchild of
|
||||||
|
that right child, use it as parent. */
|
||||||
|
ASSERT(RtlLeftChildAvl(OldNode) == NULL);
|
||||||
*Parent = OldNode;
|
*Parent = OldNode;
|
||||||
return TableInsertAsLeft;
|
return TableInsertAsLeft;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue