]> git.sur5r.net Git - cc65/blobdiff - src/cc65/function.c
Renamed the defines in symdefs.h to something more meaningful. They were named
[cc65] / src / cc65 / function.c
index 09f44d39c3e52b04283c9931f4c4509fb73cc290..8944d10077583c722124f0b19c75a8c5cf5f0921 100644 (file)
@@ -359,7 +359,7 @@ static void F_RestoreRegVars (Function* F)
 }
 
 
-
+    
 /*****************************************************************************/
 /*                                          code                                    */
 /*****************************************************************************/
@@ -380,9 +380,9 @@ void NewFunc (SymEntry* Func)
     /* Reenter the lexical level */
     ReenterFunctionLevel (D);
 
-    /* Check if the function header contains unnamed parameters. These are 
+    /* Check if the function header contains unnamed parameters. These are
      * only allowed in cc65 mode.
-     */ 
+     */
     if ((D->Flags & FD_UNNAMED_PARAMS) != 0 && (IS_Get (&Standard) != STD_CC65)) {
         Error ("Parameter name omitted");
     }
@@ -439,6 +439,9 @@ void NewFunc (SymEntry* Func)
     /* Allocate code and data segments for this function */
     Func->V.F.Seg = PushSegments (Func);
 
+    /* Allocate a new literal pool */
+    PushLiteralPool (Func);
+
     /* If this is a fastcall function, push the last parameter onto the stack */
     if (IsQualFastcall (Func->Type) && D->ParamCount > 0) {
 
@@ -539,6 +542,9 @@ void NewFunc (SymEntry* Func)
     /* Eat the closing brace */
     ConsumeRCurly ();
 
+    /* Restore the old literal pool, remembering the one for the function */
+    Func->V.F.LitPool = PopLiteralPool ();
+
     /* Switch back to the old segments */
     PopSegments ();