From 433521231784c6ce26900f88c382bee63cdd169b Mon Sep 17 00:00:00 2001 From: Teddy Date: Sun, 4 May 2014 02:37:59 +0800 Subject: resolve interval building issues in loops --- semantics.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'semantics.c') diff --git a/semantics.c b/semantics.c index 75ee872..501d6eb 100644 --- a/semantics.c +++ b/semantics.c @@ -271,6 +271,7 @@ CVar_t cvar_create(char *name, CType_t type, CNode *ast) { cv->initr = NULL; cv->defsite = NULL; cv->global = 0; + cv->weight = 0; return cv; } @@ -803,7 +804,7 @@ ExpType exp_check_arith(ExpType op1, ExpType op2, CNode *p, char kind) { res.type = basic_type_int; if ((p->ext.is_const = lch->ext.is_const && rch->ext.is_const)) { - int l = lch->ext.const_val, + long l = lch->ext.const_val, r = rch->ext.const_val, *a = &(p->ext.const_val); switch (kind) @@ -830,7 +831,7 @@ ExpType exp_check_bitwise(ExpType op1, ExpType op2, CNode *p, char kind) { res.type = basic_type_int; if ((p->ext.is_const = lch->ext.is_const && rch->ext.is_const)) { - int l = lch->ext.const_val, + long l = lch->ext.const_val, r = rch->ext.const_val, *a = &(p->ext.const_val); switch (kind) @@ -888,7 +889,7 @@ ExpType exp_check_add(ExpType op1, ExpType op2, CNode *p, char kind) { } if ((p->ext.is_const = lch->ext.is_const && rch->ext.is_const)) { - int r = rch->ext.const_val, + long r = rch->ext.const_val, *a = &(p->ext.const_val); if (t1 == CARR) { @@ -1001,7 +1002,7 @@ ExpType exp_check_logical(ExpType op1, ExpType op2, CNode *p, char kind) { if ((p->ext.is_const = lch->ext.is_const && rch->ext.is_const)) { - int l = lch->ext.const_val, + long l = lch->ext.const_val, r = rch->ext.const_val, *a = &(p->ext.const_val); switch (kind) @@ -1052,7 +1053,7 @@ ExpType exp_check_equality(ExpType op1, ExpType op2, CNode *p, int kind) { res.type = basic_type_int; if ((p->ext.is_const = lch->ext.is_const && rch->ext.is_const)) { - int l = lch->ext.const_val, + long l = lch->ext.const_val, r = rch->ext.const_val, *a = &(p->ext.const_val); switch (kind) -- cgit v1.2.3-70-g09d2