diff options
-rw-r--r-- | sem_check.c | 8 | ||||
-rw-r--r-- | tree.c | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/sem_check.c b/sem_check.c index ae1fa4c..2e9b5ba 100644 --- a/sem_check.c +++ b/sem_check.c @@ -53,6 +53,14 @@ ptree *t; case ADDOP : case MULOP : + if (!(t->r && t->l)) + yyerror("Missing nodes\n"); + + if (t->r->ret_type == t->l->ret_type) + return t->r->ret_type; + else + yyerror("Misssing nodes\n"); + break; case RELOP : if (!(t->r && t->l)) yyerror("Missing nodes\n"); @@ -136,7 +136,6 @@ ptree *t; fprintf(stderr, "\t%d", t->type); yyerror("Error in tree_print"); } - fprintf(stderr, "\nWHAT: %d\n", t->type); set_ret_type(t->l); set_ret_type(t->r); t->ret_type = check_ret_type(t); |