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));
/* Remember this node for later */
E->Left = FreeExprNodes;
FreeExprNodes = E;
+ ++FreeNodeCount;
} else {
/* Free the memory */
xfree (E);
break;
default:
- if (LooseCharTerm && CurTok.Tok == TOK_STRCON &&
+ if (LooseCharTerm && CurTok.Tok == TOK_STRCON &&
SB_GetLen (&CurTok.SVal) == 1) {
/* A character constant */
N = GenLiteralExpr (TgtTranslateChar (SB_At (&CurTok.SVal, 0)));
{
if (Root) {
FreeExpr (Root->Left);
- FreeExpr (Root->Right);
- FreeExprNode (Root);
+ FreeExpr (Root->Right);
+ FreeExprNode (Root);
}
}