summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2012-04-06 13:47:07 -0700
committerBrad Beckmann <Brad.Beckmann@amd.com>2012-04-06 13:47:07 -0700
commit70682e36ddebee06a8658d7fee05ccea519d276c (patch)
treeeac40df0f6dab798d7b0c8c7173e4c74005f9488 /src
parent5838ed7290461a253587d854226758b84afbb54d (diff)
downloadgem5-70682e36ddebee06a8658d7fee05ccea519d276c.tar.xz
slicc: fixed error message when the type has no inheritance
Diffstat (limited to 'src')
-rw-r--r--src/mem/slicc/ast/MemberExprAST.py7
1 files changed, 4 insertions, 3 deletions
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))