1 Star 0 Fork 8

dongjiao_joan/python-pythran_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-fix-leak-on-slices-when-converting-a-gexpr-back-to-python.patch 929 Bytes
一键复制 编辑 原始数据 按行查看 历史
From b65ff8f51b710a8496f3b2d7fc1fcbe7bc68ac53 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
Date: Tue, 23 Apr 2024 23:26:02 +0200
Subject: [PATCH] FIx leak on slices when converting a gexpr back to python
Fix https://github.com/serge-sans-paille/pythran/issues/2200
---
pythran/pythonic/types/ndarray.hpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/pythran/pythonic/types/ndarray.hpp b/pythran/pythonic/types/ndarray.hpp
index d0aa75925..191933ccd 100644
--- a/pythran/pythonic/types/ndarray.hpp
+++ b/pythran/pythonic/types/ndarray.hpp
@@ -1531,6 +1531,7 @@ PyObject *to_python<types::numpy_gexpr<Arg, S...>>::convert(
: ::to_python(v.slices);
PyObject *base = ::to_python(v.arg);
PyObject *res = PyObject_GetItem(base, slices);
+ Py_DECREF(slices);
Py_DECREF(base);
if (transpose) {
PyObject *Transposed =
--
2.43.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dongjiao-joan/python-pythran_1.git
git@gitee.com:dongjiao-joan/python-pythran_1.git
dongjiao-joan
python-pythran_1
python-pythran_1
master

搜索帮助