From: uz Date: Sun, 16 Aug 2009 23:37:09 +0000 (+0000) Subject: Change order, so that the forced imports for main() go into the global X-Git-Tag: V2.13.0rc1~224 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=548dfd306047d50b195f9db17c77096df7e46f9e;p=cc65 Change order, so that the forced imports for main() go into the global segments and not the one for main(). git-svn-id: svn://svn.cc65.org/cc65/trunk@4031 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/function.c b/src/cc65/function.c index 9c2c3f45d..b8f1cb753 100644 --- a/src/cc65/function.c +++ b/src/cc65/function.c @@ -364,9 +364,6 @@ void NewFunc (SymEntry* Func) /* Function body now defined */ Func->Flags |= SC_DEF; - /* Allocate code and data segments for this function */ - Func->V.F.Seg = PushSegments (Func); - /* Special handling for main() */ if (strcmp (Func->Name, "main") == 0) { /* Main cannot be a fastcall function */ @@ -395,6 +392,9 @@ void NewFunc (SymEntry* Func) } } + /* Allocate code and data segments for this function */ + Func->V.F.Seg = PushSegments (Func); + /* If this is a fastcall function, push the last parameter onto the stack */ if (IsQualFastcall (Func->Type) && D->ParamCount > 0) {