Skip to content

Commit f9c463c

Browse files
committed
Skip managed handles in call_traverse
1 parent d50f75c commit f9c463c

File tree

1 file changed

+5
-0
lines changed
  • graalpython/com.oracle.graal.python.cext/src

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343
static inline int
4444
call_traverse(traverseproc traverse, PyObject *op, visitproc visit, void *arg)
4545
{
46+
if (points_to_py_handle_space(op)) {
47+
// Ignore managed handles. Some builtin types don't (yet) create native objects when subclassed in native,
48+
// so they can end up with native traverse. Example is pybind11_static_property that subclasses builtin property
49+
return 0;
50+
}
4651
if (!traverse) {
4752
PyTruffle_Log(PY_TRUFFLE_LOG_FINE,
4853
"type '%.100s' is a GC type but tp_traverse is NULL",

0 commit comments

Comments
 (0)