From: Bernhard Urban Date: Mon, 7 Jun 2010 08:45:43 +0000 (+0200) Subject: gesamt: vars richtig poppen! X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=uebersetzerbau-ss10.git;a=commitdiff_plain;h=7ba1a3cafae8f8c6bf6caaedf5cc4a3f73a5aa10 gesamt: vars richtig poppen! --- 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@,)