From: cuz Date: Tue, 4 Nov 2003 19:02:11 +0000 (+0000) Subject: Changed freeing symbol relations, cosmetic changes X-Git-Tag: V2.12.0~1189 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5881a2b4f59e80506fec4423ceedf72a4f960a93;p=cc65 Changed freeing symbol relations, cosmetic changes git-svn-id: svn://svn.cc65.org/cc65/trunk@2610 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/ca65/expr.c b/src/ca65/expr.c index b5beb8e78..dd0513dd2 100644 --- a/src/ca65/expr.c +++ b/src/ca65/expr.c @@ -111,6 +111,11 @@ static void FreeExprNode (ExprNode* E) /* Free a node */ { if (E) { + if (E->Op == EXPR_SYMBOL) { + /* Remove the symbol reference */ + SymDelRef (E->V.Sym, E); + } + /* Place the symbol into the free nodes list if possible */ if (FreeNodeCount < MAX_FREE_NODES) { /* Remember this node for later */ E->Left = FreeExprNodes; @@ -951,10 +956,6 @@ void FreeExpr (ExprNode* Root) if (Root) { FreeExpr (Root->Left); FreeExpr (Root->Right); - if (Root->Op == EXPR_SYMBOL) { - /* Remove the symbol reference */ - SymDelRef (Root->V.Sym, Root); - } FreeExprNode (Root); } } @@ -1508,7 +1509,7 @@ static ExprNode* ConstExtract (ExprNode* Expr, long* Val, int Sign) /* SEG - SEG, remove it completely */ FreeExprNode (Left); FreeExprNode (Right); - FreeExprNode (Expr); + FreeExprNode (Expr); return 0; } else { Expr->Left = Left; diff --git a/src/ca65/fragment.h b/src/ca65/fragment.h index a020813af..863b4740c 100644 --- a/src/ca65/fragment.h +++ b/src/ca65/fragment.h @@ -59,7 +59,7 @@ struct Fragment { unsigned short Len; /* Length for this fragment */ unsigned char Type; /* Fragment type */ union { - unsigned char Data [4]; /* Literal values */ + unsigned char Data[4]; /* Literal values */ ExprNode* Expr; /* Expression */ } V; };