diff --git a/src/cc65/function.c b/src/cc65/function.c index fb274d8f9..c30e682a6 100644 --- a/src/cc65/function.c +++ b/src/cc65/function.c @@ -471,15 +471,15 @@ void NewFunc (SymEntry* Func) /* Generate the exit code */ g_leave (); - /* Eat the closing brace */ - ConsumeRCurly (); - /* Emit references to imports/exports */ EmitExternals (); /* Leave the lexical level */ LeaveFunctionLevel (); + /* Eat the closing brace */ + ConsumeRCurly (); + /* Switch back to the old segments */ PopSegments ();