[Lldb-commits] [PATCH] D114150: [lldb] Deobfuscate python-swigsafecast.swig

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 18 02:53:52 PST 2021


labath created this revision.
labath added reviewers: JDevlieghere, jingham.
labath requested review of this revision.
Herald added a project: LLDB.

This file was way more complicated than it needed to be.

This patch removes the automagic reference-to-pointer delegation and
replaces the template specializations with regular free functions
(taking reference arguments).

The reason I chose references is twofold:

- there are more arguments being passed by reference than by pointer
- the reference arguments make it more obvious that there is a lot of leaking going on in there.

Currently, the code was assuming that the pointer arguments have some
kind of a special meaning and that pointer functions take ownership of
their arguments, which isn't true (it's possible it was true at some
point in the past, I haven't done the archeology).

This makes it easier to implement proper lifetime management in
follow-up patches.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D114150

Files:
  lldb/bindings/python/python-swigsafecast.swig
  lldb/bindings/python/python-wrapper.swig

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114150.388141.patch
Type: text/x-patch
Size: 15251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20211118/fa88e4f6/attachment.bin>


More information about the lldb-commits mailing list