[Lldb-commits] [PATCH] D77480: Fix illegal early call to PyBuffer_Release in swig typemaps

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 6 03:13:19 PDT 2020


labath added a comment.

Thanks for getting back to this. Is there any reasonable way of testing this (e.g. an existing python class with temporary buffer storage), or would we have to implement our own PyBuffer object?



================
Comment at: lldb/bindings/python/python-typemaps.swig:493-495
+class Py_buffer_RAII {
+public:
+  Py_buffer m_buffer = {};
----------------
please delete `public`, s/class/struct and delete `m_` from `m_buffer`. ([[ http://llvm.org/docs/CodingStandards.html#use-of-class-and-struct-keywords || llvm guidelines ]] say we should use struct for classes with public members, and lldb does not (typically) use the `m_` prefix in such classes.)


================
Comment at: lldb/bindings/python/python-typemaps.swig:500
+  }
+};
+
----------------
Could you also `= delete` the copy operations to make sure nothing funny happens with those.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77480/new/

https://reviews.llvm.org/D77480





More information about the lldb-commits mailing list