diff options
Diffstat (limited to 'src/mem/slicc/ast')
-rw-r--r-- | src/mem/slicc/ast/InPortDeclAST.py | 2 | ||||
-rw-r--r-- | src/mem/slicc/ast/PeekStatementAST.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mem/slicc/ast/InPortDeclAST.py b/src/mem/slicc/ast/InPortDeclAST.py index 75f917f9a..c5539fe52 100644 --- a/src/mem/slicc/ast/InPortDeclAST.py +++ b/src/mem/slicc/ast/InPortDeclAST.py @@ -59,7 +59,7 @@ class InPortDeclAST(DeclAST): type = self.queue_type.type in_port = Var(self.symtab, self.ident, self.location, type, str(code), - self.pairs) + self.pairs, machine, self.var_expr) symtab.newSymbol(in_port) symtab.pushFrame() diff --git a/src/mem/slicc/ast/PeekStatementAST.py b/src/mem/slicc/ast/PeekStatementAST.py index d267df26e..cecb9aa9f 100644 --- a/src/mem/slicc/ast/PeekStatementAST.py +++ b/src/mem/slicc/ast/PeekStatementAST.py @@ -62,7 +62,12 @@ class PeekStatementAST(StatementAST): // Declare message const $mtid* in_msg_ptr M5_VAR_USED; in_msg_ptr = dynamic_cast<const $mtid *>(($qcode).${{self.method}}()); - assert(in_msg_ptr != NULL); // Check the cast result + if (in_msg_ptr == NULL) { + // If the cast fails, this is the wrong inport (wrong message type). + // Throw an exception, and the caller will decide to either try a + // different inport or punt. + throw RejectException(); + } ''') if self.pairs.has_key("block_on"): |