From 855908164845f19421c72a552c944efe7abcf933 Mon Sep 17 00:00:00 2001 From: Nilay Vaish Date: Wed, 8 Jan 2014 04:26:25 -0600 Subject: [PATCH] ruby: slicc: remove variable 'addr' used in calls to doTransition This variable causes trouble if a variable of same name is declared in a protocol file. Hence it is being eliminated. --- src/mem/slicc/ast/FuncCallExprAST.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mem/slicc/ast/FuncCallExprAST.py b/src/mem/slicc/ast/FuncCallExprAST.py index d1daf1f9f..49cd2e8e2 100644 --- a/src/mem/slicc/ast/FuncCallExprAST.py +++ b/src/mem/slicc/ast/FuncCallExprAST.py @@ -93,7 +93,8 @@ class FuncCallExprAST(ExprAST): for expr,expected_type in zip(self.exprs, func.param_types): # Check the types of the parameter actual_type,param_code = expr.inline(True) - if str(actual_type) != str(expected_type): + if str(actual_type) != 'OOD' and \ + str(actual_type) != str(expected_type): expr.error("Type mismatch: expected: %s actual: %s" % \ (expected_type, actual_type)) cvec.append(param_code) @@ -116,23 +117,22 @@ class FuncCallExprAST(ExprAST): if self.proc_name == "trigger": code(''' { - Address addr = ${{cvec[1]}}; ''') if machine.TBEType != None and machine.EntryType != None: code(''' - TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, ${{cvec[3]}}, addr); + TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, ${{cvec[3]}}, ${{cvec[1]}}); ''') elif machine.TBEType != None: code(''' - TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, addr); + TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, ${{cvec[1]}}); ''') elif machine.EntryType != None: code(''' - TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, addr); + TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[2]}}, ${{cvec[1]}}); ''') else: code(''' - TransitionResult result = doTransition(${{cvec[0]}}, addr); + TransitionResult result = doTransition(${{cvec[0]}}, ${{cvec[1]}}); ''') code(''' -- 2.30.2