Skip to content

Commit 3c4d840

Browse files
committed
[GR-65330] Revert breaking ABI in graalpy242 wheels
1 parent 2062411 commit 3c4d840

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

graalpython/com.oracle.graal.python.cext/include/cpython/tupleobject.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ PyAPI_FUNC(PyObject **) PyTruffleTuple_GetItems(PyObject *op);
4141

4242
// GraalPy change: Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
4343
PyAPI_FUNC(void) PyTuple_SET_ITEM(PyObject*, Py_ssize_t, PyObject*);
44+
45+
/* Inline function to be used in the PyTuple_SET_ITEM macro. */
46+
static inline void graalpy_tuple_set_item(PyObject *op, Py_ssize_t index, PyObject *value) {
47+
PyTruffleTuple_GetItems(op)[index] = value;
48+
}
4449
#define PyTuple_SET_ITEM(op, index, value) \
45-
PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))
50+
graalpy_tuple_set_item(_PyObject_CAST(op), (index), _PyObject_CAST(value))
4651

4752
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);

graalpython/com.oracle.graal.python.cext/src/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,5 +1444,5 @@ _PyTuple_GET_ITEM(PyObject* a, Py_ssize_t b) {
14441444
#undef PyTuple_SET_ITEM
14451445
// Export PyTuple_SET_ITEM as regular API function to use in PyO3 and others
14461446
void PyTuple_SET_ITEM(PyObject* op, Py_ssize_t index, PyObject* value) {
1447-
PyTruffleTuple_GetItems(op)[index] = value;
1447+
graalpy_tuple_set_item(op, index, value);
14481448
}

0 commit comments

Comments
 (0)