mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 16:45:47 +00:00
common: tree: Avoid a nullptr dereference.
This commit is contained in:
parent
006a51c86b
commit
9d01b31e3f
1 changed files with 1 additions and 1 deletions
|
@ -322,7 +322,7 @@ void RB_INSERT_COLOR(RBHead<Node>* head, Node* elm) {
|
|||
template <typename Node>
|
||||
void RB_REMOVE_COLOR(RBHead<Node>* head, Node* parent, Node* elm) {
|
||||
Node* tmp;
|
||||
while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root()) {
|
||||
while ((elm == nullptr || RB_IS_BLACK(elm)) && elm != head->Root() && parent != nullptr) {
|
||||
if (RB_LEFT(parent) == elm) {
|
||||
tmp = RB_RIGHT(parent);
|
||||
if (RB_IS_RED(tmp)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue