From: Brad Beckmann Date: Fri, 6 Apr 2012 20:47:07 +0000 (-0700) Subject: slicc: fixed error message when the type has no inheritance X-Git-Tag: stable_2012_06_28~137 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70682e36ddebee06a8658d7fee05ccea519d276c;p=gem5.git slicc: fixed error message when the type has no inheritance --- diff --git a/src/mem/slicc/ast/MemberExprAST.py b/src/mem/slicc/ast/MemberExprAST.py index 6a6fc49bb..320146065 100644 --- a/src/mem/slicc/ast/MemberExprAST.py +++ b/src/mem/slicc/ast/MemberExprAST.py @@ -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))