================ @@ -1552,68 +1553,85 @@ class Cursor(Structure): _fields_ = [("_kind_id", c_int), ("xdata", c_int), ("data", c_void_p * 3)] + _tu: TranslationUnit + + # This ensures that no operations are possible on null cursors + # by guarding all method calls with a not-null assert + def __getattribute__(self, key: str) -> object: ---------------- Endilll wrote:
I understand what do you here, but I'm not sure I like the cleverness and non-locality relative to the methods that are affected. Do you insist on doing it this way instead of adding an assert to every method that needs it? https://github.com/llvm/llvm-project/pull/138103 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits