mirror of
https://github.com/ZDoom/acc.git
synced 2024-11-25 13:21:33 +00:00
- Fixed: When DeleteNode() deleted a node with two children, it freed the name of the
node that was moved into the spot of the deleted node, effectively making the immediate predecessor or successor of the deleted node inaccessible, since it was left with freed memory as a name. SVN r1427 (trunk)
This commit is contained in:
parent
83b212acbb
commit
e0c76d6e4d
1 changed files with 3 additions and 0 deletions
3
symbol.c
3
symbol.c
|
@ -518,6 +518,7 @@ static void FreeNodesAtDepth(symbolNode_t **root, int depth)
|
|||
static void DeleteNode(symbolNode_t *node, symbolNode_t **parent_p)
|
||||
{
|
||||
symbolNode_t **temp;
|
||||
char *nametemp;
|
||||
|
||||
if(node->left == NULL)
|
||||
{
|
||||
|
@ -553,7 +554,9 @@ static void DeleteNode(symbolNode_t *node, symbolNode_t **parent_p)
|
|||
temp = &(*temp)->left;
|
||||
}
|
||||
}
|
||||
nametemp = node->name;
|
||||
node->name = (*temp)->name;
|
||||
(*temp)->name = nametemp;
|
||||
node->type = (*temp)->type;
|
||||
node->unused = (*temp)->unused;
|
||||
node->imported = (*temp)->imported;
|
||||
|
|
Loading…
Reference in a new issue