You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix reference count errors with PyCode_* functions
Summary:
These functions return strong references on Python 3.11 and later. The
compatibility shims we had in cinderx/Common/code.h were wrong, they returned
borrowed references, and we wrote code expecting their results to be borrowed.
Switch the compatibility shims to use strong references and fix callsites to
properly decref them as needed. Callsites in shadowcode and the 3.10
interpreter can just be inlined and use borrowed references. That code plus the
shims will go away once 3.10 support goes away (hopefully soon).
The issue was pointed out to me by Claude. The solution it generated was a
mess, so I handwrote this instead.
Reviewed By: kddnewton, jbower-fb
Differential Revision: D94730099
fbshipit-source-id: 79e6ec81f63314500cdd8bded6792fc95e760250
0 commit comments