# HG changeset patch # User lost@l-w.ca # Date 1296186404 25200 # Node ID 77626fc37af2ce25c69e6842d92aa24943a51b4c # Parent 26aa76da75ad37bf9c1256eb6ba91c252b0ab8cb Added support for removing stack from in epilog diff -r 26aa76da75ad -r 77626fc37af2 lwbasic/compiler.c --- a/lwbasic/compiler.c Thu Jan 27 20:44:57 2011 -0700 +++ b/lwbasic/compiler.c Thu Jan 27 20:46:44 2011 -0700 @@ -169,7 +169,7 @@ } } /* output function/sub epilog */ - emit_epilog(state); + emit_epilog(state, 0); lw_free(state -> currentsub); state -> currentsub = NULL; diff -r 26aa76da75ad -r 77626fc37af2 lwbasic/emit.c --- a/lwbasic/emit.c Thu Jan 27 20:44:57 2011 -0700 +++ b/lwbasic/emit.c Thu Jan 27 20:46:44 2011 -0700 @@ -41,7 +41,11 @@ } } -void emit_epilog(cstate *state) +void emit_epilog(cstate *state, int framesize) { + if (framesize > 0) + { + printf("\tleas %d,s\n", framesize); + } printf("\trts\n"); } diff -r 26aa76da75ad -r 77626fc37af2 lwbasic/lwbasic.h --- a/lwbasic/lwbasic.h Thu Jan 27 20:44:57 2011 -0700 +++ b/lwbasic/lwbasic.h Thu Jan 27 20:46:44 2011 -0700 @@ -101,7 +101,7 @@ #ifndef __emit_c_seen__ extern void emit_prolog(cstate *state, int vis, int framesize); -extern void emit_epilog(cstate *state); +extern void emit_epilog(cstate *state, int framesize); #endif