Fix memleak in cascaded comparisons.
authorRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 05:55:25 +0000 (21:55 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Sat, 21 Feb 2009 05:55:25 +0000 (21:55 -0800)
Cython/Compiler/ExprNodes.py

index 6f77046f0fe404c2a2f9c608559da08c419061d2..47f265ec4ac5f57fa86e4f47ce5ffd41db03fb24 100644 (file)
@@ -4814,6 +4814,7 @@ class CascadedCmpNode(Node, CmpNode):
     def generate_evaluation_code(self, code, result, operand1):
         if self.type.is_pyobject:
             code.putln("if (__Pyx_PyObject_IsTrue(%s)) {" % result)
+            code.put_decref(result, self.type)
         else:
             code.putln("if (%s) {" % result)
         self.operand2.generate_evaluation_code(code)