Skip to content

Commit 4db48d3

Browse files
committed
Autoreplace ob_item access with PySequence_Fast_ITEMS
1 parent 7f23547 commit 4db48d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

graalpython/lib-graalpython/modules/autopatch_capi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ def consume_whitespace_forward(idx):
154154
# avoid direct access:
155155
r'\W(ob_type)\W': (replace_field_access, 'Py_TYPE(%receiver)'),
156156
r'\W(ob_refcnt)\W': (replace_field_access, 'Py_REFCNT(%receiver)'),
157+
r'\W(ob_item)\W': (replace_field_access, 'PySequence_Fast_ITEMS(%receiver)'),
157158
r'^\s*()(std::)?free\((const_cast<char \*>)?\(?\w+->m_ml->ml_doc\)?\);': (simple_replace, '//'),
158159
r'\W(m_ml\s*->\s*ml_doc)\W': (replace_field_access, 'PyObject_GetDoc((PyObject*)(%receiver))', 'PyObject_SetDoc((PyObject*)(%receiver), %value)'),
159160
# already defined by GraalPy:

0 commit comments

Comments
 (0)