diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2016-01-21 16:51:20 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2016-01-21 16:51:20 +0800 |
commit | 17d17e0ee801ba40cd8f83d29422449001d19941 (patch) | |
tree | 9bdcc42cbbc104cdbc924a82cd56dc2f2e212203 /src | |
parent | acf881315dd1052c5e2617f0c4dd57a7b54fb077 (diff) | |
download | compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar.gz compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar.bz2 compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar.lz compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar.xz compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.tar.zst compiler2015-17d17e0ee801ba40cd8f83d29422449001d19941.zip |
Fix stack restoration after function calls
Diffstat (limited to 'src')
-rw-r--r-- | src/code-generation.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/code-generation.c b/src/code-generation.c index c56f523..a96aaf6 100644 --- a/src/code-generation.c +++ b/src/code-generation.c @@ -534,7 +534,7 @@ static void call_function(CcmmcAst *id, CcmmcState *state, if (call_param_count > 8) fprintf(state->asm_output, "\tadd\tsp, sp, %zu\n", - call_param_count * 8); + (call_param_count - 8) * 8); ccmmc_register_caller_load(state->reg_pool); ccmmc_register_load_arguments(state->reg_pool, stored_param_count); for (i = 0; i < call_param_count; i++) |