Skip to content

Commit

Permalink
Fixed segname pragmas right after a function definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
acqn committed Jan 18, 2024
1 parent 92ee03f commit 9471e12
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cc65/function.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,9 +685,6 @@ void NewFunc (SymEntry* Func, FuncDesc* D)
/* Leave the lexical level */
LeaveFunctionLevel ();

/* Eat the closing brace */
ConsumeRCurly ();

/* Restore the old literal pool, remembering the one for the function */
Func->V.F.LitPool = PopLiteralPool ();

Expand All @@ -699,6 +696,12 @@ void NewFunc (SymEntry* Func, FuncDesc* D)
/* Switch back to the old segments */
PopSegContext ();

/* Eat the closing brace after we've done everything with the function
** definition. This way we won't have troubles with pragmas right after
** the closing brace.
*/
ConsumeRCurly();

/* Reset the current function pointer */
FreeFunction (CurrentFunc);
CurrentFunc = 0;
Expand Down

0 comments on commit 9471e12

Please sign in to comment.