Skip to content

Commit 132cc4d

Browse files
committed
Fix: Correctly convert pointer in native get-set descriptor.
1 parent 25f2aa8 commit 132cc4d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graalpython/lib-graalpython/python_cext.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,10 @@ def AddGetSet(primary, name, getter, getter_wrapper, setter, setter_wrapper, doc
813813
if getter:
814814
getter_w = CreateFunction(name, getter, getter_wrapper, pclass)
815815
def member_getter(self):
816-
return capi_to_java(getter_w(self, closure))
816+
# NOTE: The 'to_java' is intended and correct because this call will do a downcall an
817+
# all args will go through 'to_sulong' then. So, if we don't convert the pointer
818+
# 'closure' to a Python value, we will get the wrong wrapper from 'to_sulong'.
819+
return capi_to_java(getter_w(self, to_java(closure)))
817820

818821
fget = member_getter
819822
if setter:

0 commit comments

Comments
 (0)