Commit 7be9f5e7 authored by Sergio Costas's avatar Sergio Costas

Added extra comments

parent 729d6817
......@@ -427,42 +427,6 @@ class crust(crust_helpers):
return retvals
# if (statement.type == "EQ_OP") or (statement.type == "NE_OP"):
# # check CRUST_POINTER == NULL, CRUST_POINTER != NULL
# param1 = statement.child1[0]
# param2 = statement.child2[0]
# if param1.t_null and (param2.type == "IDENTIFIER"):
# param1 = statement.child2[0]
# param2 = statement.child1[0]
# if param2.t_null and (param1.type == "IDENTIFIER"):
# # check cases of CRUST_VAR == NULL or NULL == CRUST_VAR
# var_data = self._find_variable(thread_status, param1.name, statement.line)
# if var_data["crust"] or (((var_data["pointer"] != 0) or ((var_data["function_params"] is not None) and (var_data["value"] != self.VALUE_FUNCTION))) and (param1.right is None) and (param1.arrays is None)):
# if statement.type == "EQ_OP":
# cd1 = self.CONDITION_FALSE
# cd2 = self.CONDITION_TRUE
# else:
# cd2 = self.CONDITION_FALSE
# cd1 = self.CONDITION_TRUE
# status = var_data["value"]
# if status == crust.VALUE_UNINITIALIZED:
# self._add_error(thread_status, self.MSG_ERROR, "Using uninitialized variable '{:s}' at line {:d}", param1.name, param1.line)
# return [ {"thread_status":thread_status, "value":self.VALUE_NOT_NULL_OR_NULL, "type":self.TYPE_NO_CRUST, "condition":self.CONDITION_FALSE_TRUE, "node":None, "pure": True} ]
# if status == crust.VALUE_NULL:
# return [ {"thread_status":thread_status, "value":self.VALUE_NULL, "type":self.TYPE_NO_CRUST, "condition":cd2, "node":None, "pure": True} ]
# if status == crust.VALUE_NOT_NULL:
# return [ {"thread_status":thread_status, "value":self.VALUE_NOT_NULL, "type":self.TYPE_NO_CRUST, "condition":cd1, "node":None, "pure": True} ]
# # status == crust.VALUE_NOT_NULL_OR_NULL or STATUS == crust.VALUE_GLOBAL
# var1 = self._copy_status(thread_status)
# var2 = thread_status
# if status == crust.VALUE_NOT_NULL_OR_NULL:
# # Only set the status if it is NOT_NULL_OR_NULL; but keep it if it is FREED
# self._set_var_value(var1, param1.name, crust.VALUE_NULL, 0, True)
# self._set_var_value(var2, param1.name, crust.VALUE_NOT_NULL, 0, True)
# return [ {"thread_status":var1, "value":self.VALUE_NULL, "type":self.TYPE_NO_CRUST, "condition":cd2, "node":None, "pure": True}, {"thread_status":var2, "value":self.VALUE_NOT_NULL, "type":self.TYPE_NO_CRUST, "condition":cd1, "node":None, "pure": True} ]
if (statement.type == "EQ_OP") or (statement.type == "NE_OP"):
retvals = []
threads1 = self._eval_statement(statement.child1[0], thread_status, False, True)
......@@ -769,6 +733,9 @@ class crust(crust_helpers):
def process_functions(self, tree, thread_status):
""" Takes each function in the tree and processes the code inside them """
last_len = 0
total_len = 0
for node in tree:
......@@ -822,6 +789,8 @@ class crust(crust_helpers):
def _process_block(self, function_name, tree, thread_status):
""" Processes a single function """
# if the function is not in the current file, don't analyze it
if (os.path.abspath(tree[0].filename) != self.filename):
return
......
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