* src/hc08/gen.c (genPcall): fix for bug #1601032
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 24 Nov 2006 05:04:05 +0000 (05:04 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Fri, 24 Nov 2006 05:04:05 +0000 (05:04 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4482 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/hc08/gen.c

index 282e00e49efbc57d529fe5206eac7426545a9032..2dbe7e574682e88707a1bc25eab2e755944cb74d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2006-11-24 Erik Petrich <epetrich AT ivorytower.norman.ok.us>
+
+       * src/hc08/gen.c (genPcall): fix for bug #1601032
+
 2006-11-23 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * device/include/mcs51/c8051f000.h, device/include/mcs51/C8051F000.h,
index 2897a99541cdfeaecc10c23c2eb0e211f37dce2e..5659f555c396a7bd46ae0851a4c36519ed41dba0 100644 (file)
@@ -2735,6 +2735,8 @@ genPcall (iCode * ic)
   emitBranch ("bsr", tlbl);
   emitBranch ("bra", rlbl);
   emitLabel (tlbl);
+  _G.stackPushes += 2; /* account for the bsr return address now on stack */
+  updateCFA();
 
   /* Push the function's address */
   aopOp (IC_LEFT (ic), ic, FALSE);
@@ -2753,6 +2755,8 @@ genPcall (iCode * ic)
   emitcode ("rts", "");
 
   emitLabel (rlbl);
+  _G.stackPushes -= 4; /* account for rts here & in called function */
+  updateCFA();
 
 
   /* if we need assign a result value */