Commit bf32ccbe authored by Sergio Costas's avatar Sergio Costas

Now the status comparer allows to have other thread status lists

parent f4a345ad
......@@ -1447,26 +1447,27 @@ class crust(object):
self._add_error(thread_status, self.MSG_ERROR, "Memory block '{:s}', initialized at line {:d}, is still in use at exit point in line {:d}", variable, init_line, line)
def _compare_status(self, ex_point, status):
def _compare_status(self, ex_point, status, status_list):
""" Gets the current status and compares it with all the previous status in the same execution point.
If the current status has been already found, it returns TRUE. If not, it will be stored and will return FALSE
Parameters:
ex_point: the execution point UID
status: the status to compare
status_list: a dictionary with arrays with all the old statuses to check
Returns:
TRUE if the status has been already checked; FALSE if not
"""
current_vars = status["variables"][0]
if not ex_point in self.expoints:
self.expoints[ex_point] = [ current_vars.copy() ]
if not ex_point in status_list:
status_list[ex_point] = [ current_vars.copy() ]
return False
for old_expoint in self.expoints[ex_point]:
for old_expoint in status_list[ex_point]:
if old_expoint == current_vars:
return True
self.expoints[ex_point].append(current_vars.copy())
status_list[ex_point].append(current_vars.copy())
return False
......@@ -1512,7 +1513,7 @@ class crust(object):
# if we are at the end of the function, check the global variables
self._check_global_vars(thread_status, node.line)
else:
if self._compare_status(node.uid, thread_status):
if self._compare_status(node.uid, thread_status, self.expoints):
return None
return self._check_return_block(tree[1:], thread_status)
......
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