From 7ba1a3cafae8f8c6bf6caaedf5cc4a3f73a5aa10 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 7 Jun 2010 10:45:43 +0200 Subject: [PATCH] gesamt: vars richtig poppen! --- gesamt/code.bfe | 4 ++-- gesamt/parser.y | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gesamt/code.bfe b/gesamt/code.bfe index 1c6c410..76175ab 100644 --- a/gesamt/code.bfe +++ b/gesamt/code.bfe @@ -195,7 +195,7 @@ void make_call(struct treenode *bnode) printf("\txchg %%%s, %d(%%rsp)\n", param_reg(j), j*8); } printf("\t//vars pushen\n"); - for(j = 6; j > 6 - bnode->vars - 1; j--) { + for(j = 6; j > 6 - bnode->vars; j--) { printf("\tpushq %%%s\n", param_reg(j)); } @@ -217,7 +217,7 @@ void make_call(struct treenode *bnode) } /* vars poppen */ - for(j = 6 - bnode->vars; j < 6+1; j++) { + for(j = 7 - bnode->vars; j < 7; j++) { printf("\tpopq %%%s\n", param_reg(j)); } diff --git a/gesamt/parser.y b/gesamt/parser.y index f564b15..2d42baa 100644 --- a/gesamt/parser.y +++ b/gesamt/parser.y @@ -182,7 +182,6 @@ Statement: lblcountinout() @i @Statement.vars_out@ = @Statement.vars_in@ + 1; - @i @Expr.vars_in@ = @Statement.vars_in@ - 1; xxputsin(@Expr.s@,) -- 2.25.1