Commit 150d9bab authored by Stefan Behnel's avatar Stefan Behnel

fix BoolBinopNode handling in SwitchTransform

parent 0891aeea
...@@ -803,7 +803,7 @@ class IterationTransform(Visitor.EnvTransform): ...@@ -803,7 +803,7 @@ class IterationTransform(Visitor.EnvTransform):
]) ])
class SwitchTransform(Visitor.CythonTransform): class SwitchTransform(Visitor.EnvTransform):
""" """
This transformation tries to turn long if statements into C switch statements. This transformation tries to turn long if statements into C switch statements.
The requirement is that every clause be an (or of) var == value, where the var The requirement is that every clause be an (or of) var == value, where the var
...@@ -979,6 +979,7 @@ class SwitchTransform(Visitor.CythonTransform): ...@@ -979,6 +979,7 @@ class SwitchTransform(Visitor.CythonTransform):
or len(conditions) < 2 \ or len(conditions) < 2 \
or self.has_duplicate_values(conditions): or self.has_duplicate_values(conditions):
self.visitchildren(node) self.visitchildren(node)
node.wrap_operands(self.current_env()) # in case we changed the operands
return node return node
return self.build_simple_switch_statement( return self.build_simple_switch_statement(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment