1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-09 17:33:00 +00:00

Fixed an error in the special purpose allocator in expr.c.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5109 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2011-08-02 16:46:47 +00:00
parent 1df46aed11
commit ca0877adb6

View File

@ -94,10 +94,11 @@ static ExprNode* NewExprNode (unsigned Op)
ExprNode* N;
/* Do we have some nodes in the list already? */
if (FreeExprNodes) {
if (FreeNodeCount) {
/* Use first node from list */
N = FreeExprNodes;
FreeExprNodes = N->Left;
--FreeNodeCount;
} else {
/* Allocate fresh memory */
N = xmalloc (sizeof (ExprNode));
@ -124,6 +125,7 @@ static void FreeExprNode (ExprNode* E)
/* Remember this node for later */
E->Left = FreeExprNodes;
FreeExprNodes = E;
++FreeNodeCount;
} else {
/* Free the memory */
xfree (E);