projects
/
cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
aa51c51
)
fix tp_clear() according to Python docs: zero out member pointer before decrefing...
author
Stefan Behnel
<scoder@users.berlios.de>
Sat, 12 Jan 2008 20:33:30 +0000
(21:33 +0100)
committer
Stefan Behnel
<scoder@users.berlios.de>
Sat, 12 Jan 2008 20:33:30 +0000
(21:33 +0100)
Cython/Compiler/ModuleNode.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ModuleNode.py
b/Cython/Compiler/ModuleNode.py
index 5c78abda441ef8c103c57ab8a94f78b1df89c136..5b918dabeeaf13b6d6eedc00141584568b23b5eb 100644
(file)
--- a/
Cython/Compiler/ModuleNode.py
+++ b/
Cython/Compiler/ModuleNode.py
@@
-758,6
+758,7
@@
class ModuleNode(Nodes.Node, Nodes.BlockNode):
py_attrs.append(entry)
if py_attrs:
self.generate_self_cast(scope, code)
+ code.putln("PyObject* tmp;")
if base_type:
code.putln("if (%s->tp_clear) {" % base_type.typeptr_cname)
code.putln(
@@
-766,8
+767,8
@@
class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("}")
for entry in py_attrs:
name = "p->%s" % entry.cname
- code.put
_xdecref(name, entry.type
)
- code.put
_init_var_to_py_none(entry, "p->%s
")
+ code.put
ln("tmp = %s; %s = 0;" % (name, name)
)
+ code.put
ln("Py_XDECREF(tmp);
")
code.putln(
"return 0;")
code.putln(