aboutsummaryrefslogtreecommitdiff
path: root/semantics.c
diff options
context:
space:
mode:
authorTeddy <ted.sybil@gmail.com>2014-05-04 02:37:59 +0800
committerTeddy <ted.sybil@gmail.com>2014-05-04 02:37:59 +0800
commit433521231784c6ce26900f88c382bee63cdd169b (patch)
tree99a61049300c73e7d5ab56c65c1776927efc206e /semantics.c
parent3730b0fa4b526f5acab73f3f5483f6c044178d3d (diff)
resolve interval building issues in loops
Diffstat (limited to 'semantics.c')
-rw-r--r--semantics.c11
1 files changed, 6 insertions, 5 deletions
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)