aboutsummaryrefslogtreecommitdiff
path: root/sem_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'sem_check.c')
-rw-r--r--sem_check.c8
1 files changed, 8 insertions, 0 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");