diff --git a/src/mem/slicc/ast/OperatorExprAST.py b/src/mem/slicc/ast/OperatorExprAST.py index 87417b50ea..c024c3071f 100644 --- a/src/mem/slicc/ast/OperatorExprAST.py +++ b/src/mem/slicc/ast/OperatorExprAST.py @@ -62,7 +62,15 @@ class InfixOperatorExprAST(ExprAST): # Figure out what the input and output types should be if self.op in ("==", "!=", ">=", "<=", ">", "<"): output = "bool" - if ltype != rtype: + + if ( + str(ltype) == "Addr" + and str(rtype) == "int" + or str(ltype) == "int" + and str(rtype) == "Addr" + ): + pass + elif ltype != rtype: self.error( "Type mismatch: left and right operands of " + "operator '%s' must be the same type. "