Commit c2310236 authored by Sergio Costas's avatar Sergio Costas

Added check for refferences

parent b253c03b
......@@ -172,5 +172,8 @@ class Test(unittest.TestCase):
def testUsePostStructAssignment2(self):
self._generic_test("unitest/test42.c",False,[ (crusty.crusty.MSG_CRITICAL,"Assigning the crust pointer '{:s}' to the non-crust variable '{:s}' at line {:d}",'param3',"test",8) ])
def testStructAssignmentByRef(self):
self._all_fine_test("unitest/test43.c")
if __name__ == '__main__':
unittest.main()
......@@ -5,5 +5,5 @@ struct {
} *test;
int function(crust_t param3) {
test = param3; // this is legal
test = param3; // ERROR: assigning a crust element to a non-crust variable
}
typedef __crust_t__ unsigned char *crust_t;
struct {
crust_t value;
} *test;
int function(crust_t param3) {
crust_t param4 = test->value; // this is legal
}
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