slicc: fixed error message when the type has no inheritance
authorBrad Beckmann <Brad.Beckmann@amd.com>
Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)
committerBrad Beckmann <Brad.Beckmann@amd.com>
Fri, 6 Apr 2012 20:47:07 +0000 (13:47 -0700)
src/mem/slicc/ast/MemberExprAST.py

index 6a6fc49bbe28e9ec32c6c28abc367568aff90084..320146065f6df14301da4c3fd0b09e0d827898bb 100644 (file)
@@ -58,9 +58,10 @@ class MemberExprAST(ExprAST):
         else:
             if "interface" in return_type:
                interface_type = self.symtab.find(return_type["interface"]);
-               if self.field in interface_type.data_members:
-                   # Return the type of the field
-                   return interface_type.data_members[self.field].type
+               if interface_type != None:
+                   if self.field in interface_type.data_members:
+                       # Return the type of the field
+                       return interface_type.data_members[self.field].type
         self.error("Invalid object field: " +
                    "Type '%s' does not have data member %s" % \
                    (return_type, self.field))