mirror of
https://github.com/cc65/cc65.git
synced 2025-01-28 15:31:18 +00:00
Fix a problem with macro expansion count in line infos for macros.
git-svn-id: svn://svn.cc65.org/cc65/trunk@5247 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
6cdac5eb4c
commit
ae98f4bcd8
@ -126,6 +126,7 @@ struct MacExp {
|
|||||||
unsigned IfSP; /* .IF stack pointer at start of expansion */
|
unsigned IfSP; /* .IF stack pointer at start of expansion */
|
||||||
TokNode* Exp; /* Pointer to current token */
|
TokNode* Exp; /* Pointer to current token */
|
||||||
TokNode* Final; /* Pointer to final token */
|
TokNode* Final; /* Pointer to final token */
|
||||||
|
unsigned MacExpansions; /* Number of active macro expansions */
|
||||||
unsigned LocalStart; /* Start of counter for local symbol names */
|
unsigned LocalStart; /* Start of counter for local symbol names */
|
||||||
unsigned ParamCount; /* Number of actual parameters */
|
unsigned ParamCount; /* Number of actual parameters */
|
||||||
TokNode** Params; /* List of actual parameters */
|
TokNode** Params; /* List of actual parameters */
|
||||||
@ -299,6 +300,7 @@ static MacExp* NewMacExp (Macro* M)
|
|||||||
E->IfSP = GetIfStack ();
|
E->IfSP = GetIfStack ();
|
||||||
E->Exp = M->TokRoot;
|
E->Exp = M->TokRoot;
|
||||||
E->Final = 0;
|
E->Final = 0;
|
||||||
|
E->MacExpansions = ++MacExpansions; /* One macro expansion more */
|
||||||
E->LocalStart = LocalName;
|
E->LocalStart = LocalName;
|
||||||
LocalName += M->LocalCount;
|
LocalName += M->LocalCount;
|
||||||
E->ParamCount = 0;
|
E->ParamCount = 0;
|
||||||
@ -312,9 +314,6 @@ static MacExp* NewMacExp (Macro* M)
|
|||||||
/* Mark the macro as expanding */
|
/* Mark the macro as expanding */
|
||||||
++M->Expansions;
|
++M->Expansions;
|
||||||
|
|
||||||
/* One macro expansion more */
|
|
||||||
++MacExpansions;
|
|
||||||
|
|
||||||
/* Return the new macro expansion */
|
/* Return the new macro expansion */
|
||||||
return E;
|
return E;
|
||||||
}
|
}
|
||||||
@ -668,7 +667,7 @@ ExpandParam:
|
|||||||
if (Mac->LI) {
|
if (Mac->LI) {
|
||||||
EndLine (Mac->LI);
|
EndLine (Mac->LI);
|
||||||
}
|
}
|
||||||
Mac->LI = StartLine (&CurTok.Pos, LI_TYPE_MACRO, MacExpansions);
|
Mac->LI = StartLine (&CurTok.Pos, LI_TYPE_MACRO, Mac->MacExpansions);
|
||||||
|
|
||||||
/* Set pointer to next token */
|
/* Set pointer to next token */
|
||||||
Mac->Exp = Mac->Exp->Next;
|
Mac->Exp = Mac->Exp->Next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user