support non-trivial switch() values in SwitchStatNode
authorStefan Behnel <scoder@users.berlios.de>
Sun, 14 Nov 2010 17:34:04 +0000 (18:34 +0100)
committerStefan Behnel <scoder@users.berlios.de>
Sun, 14 Nov 2010 17:34:04 +0000 (18:34 +0100)
Cython/Compiler/Nodes.py

index f5a2bb73f3b2ad6ed49565781ef51a768647e9af..6556d9e2279cdbb32e63e8f6456660c126a33821 100644 (file)
@@ -4105,6 +4105,7 @@ class SwitchStatNode(StatNode):
     child_attrs = ['test', 'cases', 'else_clause']
     
     def generate_execution_code(self, code):
+        self.test.generate_evaluation_code(code)
         code.putln("switch (%s) {" % self.test.result())
         for case in self.cases:
             case.generate_execution_code(code)