Skip to content

Commit ffe982f

Browse files
committed
[lldb] Stop generating swig bindings for SBLaunchInfo copy constructor
Given the line ``` launch_info = lldb.SBLaunchInfo(None) ``` We see different behaviors across different versionf of swig. On some older versions of swig (e.g. 3.0.2) this line fails because it attempts to use the copy constructor and blows up with an invalid null reference. On newer versions of swig, this is correctly routed to the constructor taking a pointer. Prior to generating the swig bindings with the API headers, SBLaunchInfo's copy constructor was not exposed so we're effectively going back to the old behavior anyway. Differential Revision: https://reviews.llvm.org/D144228
1 parent 8045ba8 commit ffe982f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/include/lldb/API/SBLaunchInfo.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ class LLDB_API SBLaunchInfo {
2626

2727
~SBLaunchInfo();
2828

29+
#ifndef SWIG
30+
// The copy constructor for SBLaunchInfo presents some problems on some
31+
// supported versions of swig (e.g. 3.0.2). When trying to create an
32+
// SBLaunchInfo from python with the argument `None`, swig will try to call
33+
// the copy constructor instead of SBLaunchInfo(const char **). For that
34+
// reason, we avoid exposing the copy constructor to python.
2935
SBLaunchInfo(const SBLaunchInfo &rhs);
36+
#endif
3037

3138
SBLaunchInfo &operator=(const SBLaunchInfo &rhs);
3239

0 commit comments

Comments
 (0)