cython-devel
changeset 809:f612fb161cd0
Fix memory leak in cpdef function.
Also fixed error check.
Also fixed error check.
| author | Robert Bradshaw <robertwb@math.washington.edu> |
|---|---|
| date | Wed Jul 16 03:41:00 2008 -0700 (4 years ago) |
| parents | 15ba08650789 |
| children | 271c2696a0fe |
| files | Cython/Compiler/Nodes.py |
line diff
1.1 --- a/Cython/Compiler/Nodes.py Wed Jul 16 03:19:23 2008 -0700
1.2 +++ b/Cython/Compiler/Nodes.py Wed Jul 16 03:41:00 2008 -0700
1.3 @@ -1937,7 +1937,7 @@
1.4 code.putln("else {")
1.5 else:
1.6 code.putln("else if (unlikely(Py_TYPE(%s)->tp_dictoffset != 0)) {" % self_arg)
1.7 - err = code.error_goto_if_null(self_arg, self.pos)
1.8 + err = code.error_goto_if_null(self.func_node.result_code, self.pos)
1.9 # need to get attribute manually--scope would return cdef method
1.10 code.putln("%s = PyObject_GetAttr(%s, %s); %s" % (self.func_node.result_code, self_arg, self.py_func.interned_attr_cname, err))
1.11 # It appears that this type is not anywhere exposed in the Python/C API
1.12 @@ -1946,7 +1946,7 @@
1.13 code.putln('if (!%s || %s) {' % (is_builtin_function_or_method, is_overridden))
1.14 self.body.generate_execution_code(code)
1.15 code.putln('}')
1.16 -# code.put_decref(self.func_temp, PyrexTypes.py_object_type)
1.17 + code.put_decref(self.func_node.result_code, PyrexTypes.py_object_type)
1.18 code.putln("}")
1.19
1.20 class ClassDefNode(StatNode, BlockNode):
