projects
/
platform
/
upstream
/
python-cython.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b9fbca
)
fix decref before incref on buffer item assignments
author
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 3 Jul 2012 19:13:34 +0000
(21:13 +0200)
committer
Stefan Behnel
<stefan_ml@behnel.de>
Tue, 3 Jul 2012 19:13:34 +0000
(21:13 +0200)
Cython/Compiler/ExprNodes.py
patch
|
blob
|
history
diff --git
a/Cython/Compiler/ExprNodes.py
b/Cython/Compiler/ExprNodes.py
index
9ad6e22
..
49de059
100755
(executable)
--- a/
Cython/Compiler/ExprNodes.py
+++ b/
Cython/Compiler/ExprNodes.py
@@
-3150,9
+3150,8
@@
class IndexNode(ExprNode):
rhs_code = rhs.result()
code.putln("%s = %s;" % (ptr, ptrexpr))
code.put_gotref("*%s" % ptr)
- code.putln("__Pyx_DECREF(*%s); __Pyx_INCREF(%s);" % (
- ptr, rhs_code
- ))
+ code.putln("__Pyx_INCREF(%s); __Pyx_DECREF(*%s);" % (
+ rhs_code, ptr))
code.putln("*%s %s= %s;" % (ptr, op, rhs_code))
code.put_giveref("*%s" % ptr)
code.funcstate.release_temp(ptr)