From bc0844d150b4166e5edb510f1c58b3b422471ac4 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 24 Oct 2007 00:14:26 -0700 Subject: [PATCH] Decref error in except clause Temporary variables must be set to zero or they might be XDECREF'ed later, generating very hard to track bugs. --- Cython/Compiler/Nodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index ba54027b..515ed394 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2589,7 +2589,7 @@ class ExceptClauseNode(Node): self.body.generate_execution_code(code) code.exc_vars = old_exc_vars for var in self.exc_vars: - code.putln("Py_DECREF(%s);" % var) + code.putln("Py_DECREF(%s); %s = 0;" % (var, var)) code.put_goto(end_label) code.putln( "}") -- 2.26.2