Commit 1e66d920 authored by Sergio Costas's avatar Sergio Costas

Now doesn't fail when the condition in a WHILE is always TRUE (like when using a constant)

parent bd02172d
......@@ -1805,7 +1805,7 @@ class crust(object):
continue
retvals += self._check_return_block(tree[1:], thread["thread_status"])
if len(retvals) == 0:
return [(None, thread_status)]
return None
else:
return retvals
......
......@@ -937,6 +937,8 @@ class Test(unittest.TestCase):
def test221TestCalloc2(self):
self._generic_test("unitest/test221.c", [ (crust.crust.MSG_ERROR, "Memory block '{:s}', initialized at line {:d}, is still in use at exit point in line {:d}", "var", 17, 18) ])
def test222TestConditionTrue(self):
self._generic_test("unitest/test222.c", [ (crust.crust.MSG_ERROR, "Memory block '{:s}', initialized at line {:d}, is still in use at exit point in line {:d}", "var", 11, 22) ])
if __name__ == '__main__':
......
#define NULL ((void *)0)
struct crust_ts {
char var1;
int var2;
struct crust_ts *next;
};
typedef __crust__ struct crust_ts* crust_t;
int main(crust_t var) {
int a = 5;
while(1) {
if (a == 7) {
break;
}
a++;
}
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment