Commit graph

21,653 commits

Author SHA1 Message Date
Ryan Nevell
33c59614fc Fix unwrapping of LUA lightuserdata type. Add test case. 2020-02-17 09:16:24 -08:00
William S Fulton
b465531141 Add conversion operator fix to changes file 2020-02-14 07:39:02 +00:00
William S Fulton
c914b1eb78 Merge branch 'abstract-conversion-operators'
* abstract-conversion-operators:
  Add test cases for abstract user-defined conversion operators
  Recognize C++ conversion operators with trailing '= 0' as abstract
2020-02-14 07:12:26 +00:00
William S Fulton
6cec69ef7b Remove an unnecessary shared_ptr reference count increment in Ruby wrappers
When wrapping STL containers, remove a shared_ptr reference count
increment when an upcast is needed when checking type conversion
in traits_check::check.
2020-02-13 19:48:30 +00:00
William S Fulton
67a38589a8 Minor code refactor in Python traits_asptr::asptr 2020-02-13 19:32:13 +00:00
William S Fulton
e631b226ca Add changes entry for vector<shared_ptr<>> memory leak fix 2020-02-13 19:23:37 +00:00
William S Fulton
fc2f0204ba Port Ruby test of vector<shared_ptr<>> to Python
This test code tests the upcast code:
  swig_assert_equal_simple(-1, base_num2([Derived(7)]))
Although there is no explicit memory leak fix test, it does at least run the code.

Handling of None needs fixing in Python (it is working in Ruby)
Note that the Ruby implementation has a partial template specialization
for shared_ptr, whereas the Python implementation is in the generic
code!

Issue #1512
2020-02-13 19:21:30 +00:00
William S Fulton
339d427910 Merge branch 'master-fix-vector-shared_ptr'
* master-fix-vector-shared_ptr:
  fixing memleak of shared_ptr objects in python with creating a [wrapped] vector<shared_ptr<Foo>> from a list of shared_ptr<Bar> where Bar is derived from Foo.
2020-02-13 19:21:12 +00:00
Thomas REITMAYR
eb2be58a12 Add test cases for abstract user-defined conversion operators 2020-02-13 20:16:44 +01:00
Thomas REITMAYR
059bb0c0a0 Recognize C++ conversion operators with trailing '= 0' as abstract
This fix is done for all supported variants of user-defined conversion
operators and fixes swig#1723.
2020-02-13 20:16:44 +01:00
William S Fulton
e3524be164 html fixes in documentation 2020-02-07 07:27:49 +00:00
William S Fulton
63b3fe8d3b R documentation minor tweaks 2020-02-07 07:18:04 +00:00
William S Fulton
eb7160161d Merge branch 'RDocs2020A'
* RDocs2020A:
  documentation about R accessors, with examples
2020-02-07 07:06:29 +00:00
William S Fulton
012d0f7aa5 Update changes file 2020-02-06 19:09:00 +00:00
William S Fulton
94b4c7dc21 Better error checking when setting 'this' in Python
If python_append.i is modified to use:
__slots__ = []
instead of
__slots__ = ["this"]
then this additional error checking prevents a crash and shows a stack trace and error:
  AttributeError: 'ForSlots' object has no attribute 'this'

Related to issue #1674
2020-02-06 07:27:08 +00:00
William S Fulton
a01e8474f6 Fixing setting this in Python when using __slots__
Don't attempt to use the class's __dict__ for setting 'this' when
a user has extended a class with:
    __slots__ = ['this'].
Was segfaulting. Now we fall back to a simple PyObject_SetAttr if the
usual approach to setting 'this' in __dict__ does not work.

Closes #1673 Closes #1674
2020-02-06 07:08:16 +00:00
Richard Beare
c74507f024 documentation about R accessors, with examples 2020-02-03 14:37:00 +11:00
William S Fulton
a9731251a4 Disable GC checks for Ruby auto_ptr test 2020-01-31 22:45:46 +00:00
William S Fulton
e321ee30f0 Changes file correction 2020-01-31 22:28:24 +00:00
William S Fulton
ebc324dfd5 Merge branch 'ruby-autoptr'
* ruby-autoptr:
  Extend std::auto_ptr<> support to Ruby
2020-01-31 19:26:19 +00:00
William S Fulton
8c1c01f5e6 Add changes entry for Python string error checking fix 2020-01-31 19:18:23 +00:00
William S Fulton
10cbc9481f Merge branch 'Python-coverity'
* Python-coverity:
  Fix possible refleaks.
  Check Py{Bytes,String}_AsStringAndSize() for failure
2020-01-31 19:14:47 +00:00
William S Fulton
a5d50729c1 Update changes file with python crash fix 2020-01-31 19:02:42 +00:00
William S Fulton
0c00daf3a1 Merge branch 'autodoc-doxygen-fix'
* autodoc-doxygen-fix:
  Fix crash in Python backend when using empty docstrings
2020-01-31 18:57:47 +00:00
William S Fulton
a0d4218543 Minor refactor of R error handling code 2020-01-31 08:58:09 +00:00
William S Fulton
995b443948 Changes file update 2020-01-30 20:49:01 +00:00
Arnaud Barré
3fa5c8c652 Fix R memory leak on exception
There is a possible memory leak in case the SWIG_exception_fail macro
is called. The problem is related to its definition that call the
function Rf_warning. This function (as well as Rf_error) involves
a longjmp over C++ destructors on the stack. Thus, all the objects
allocated on the heap are not freed.

Closes #914
2020-01-30 20:43:39 +00:00
William S Fulton
b0ce22625b Remove redundant code from r.cxx 2020-01-30 19:04:32 +00:00
William S Fulton
f0c9229287 Add changes entry about R attribute fix 2020-01-30 18:56:59 +00:00
Vadim Zeitlin
e14532ce52 Fix crash in Python backend when using empty docstrings
Due to confusion in build_combined_docstring(), we could call
DohDelete() on the "feature:docstring" string, which resulted in a crash
when trying to use it later.

Fix this and simplify the code at the same time by ensuring that we
always use a copy of "feature:docstring" if it's not empty or don't use
it at all if it's empty -- like this we don't have to check for its
length each time before using it.

Closes #1648.
2020-01-30 16:11:18 +01:00
William S Fulton
88ef6e0931 Fix display of template classnames in generated R code 2020-01-30 08:34:07 +00:00
William S Fulton
7648542775 Merge branch 'RMemberListTrialSimplify2019'
* RMemberListTrialSimplify2019:
  ENH R abstract_access_runme
  ENH R accessor processing test
  Removed some remaining commented sections
  moved registration routine and use swig_name_get
  calling Swig_name_setget
  Used Swig_name_register so that Swig_name_wrapper produces the correct name without a separate replace call.
  Removed last instance of using Strcmp to check for a set/get method. Replaced with check for flag.
  Alternative version of using memberlist processing. This clarifies the logic within OutputMemberReferenceMethod by filtering the lists into classes, rather than doing it internally. Code isn't any shorter.
  commenting out unused code
  first pass at removing string comparisons for set/get methods
  trial changing member list processing
2020-01-30 07:29:45 +00:00
Zackery Spytz
58e409dd2b Fix possible refleaks. 2020-01-29 10:00:22 -07:00
William S Fulton
7405bd6a88 Minor tweak to director_wstring_runme.py test 2020-01-28 20:35:29 +00:00
William S Fulton
36e8d521de Add C++20 documentation chapter
[skip-ci]
2020-01-28 20:31:53 +00:00
William S Fulton
f00dfdb714
Merge pull request #1662 from jschueller/patch-1
Fix unused-parameter warning in pycontainer.swg
2020-01-26 16:07:19 +00:00
William S Fulton
f971bbffc8 Add changes entry for upcasting of shared_ptr's 2020-01-24 19:54:52 +00:00
William S Fulton
45963937d5 Test shared_ptr upcasts in Python 2020-01-24 19:54:29 +00:00
William S Fulton
b3da344765 Add some comments about shared_ptr upcast code 2020-01-24 19:46:39 +00:00
William S Fulton
564a91864a Refactor upcasts code
In preparation for possible improvement in usage of
SwigType_typedef_resolve_all - a SwigType* should be used,
not a readable name in a String*.
2020-01-23 19:30:03 +00:00
William S Fulton
0425a61fa8 shared_ptr upcast fixes for D
Same changes that were applied to Java/C# in ab7f526805
2020-01-23 18:03:22 +00:00
William S Fulton
6910e5f09c Merge branch 'shared-ptr-template-upcast'
* shared-ptr-template-upcast:
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
  comments
  Applying shared_ptr template upcast fix to CSharp, adding CSharp test, and cleanup
  Adding test case demonstrating issue where SWIG does not generate a correctly typed, upcasted shared_ptr for a template instantiation deriving from a base class
  WIP - Use the non-encoded type string for upcasting a shared_ptr of a derived type to a shared_ptr of the base type
2020-01-17 18:45:30 +00:00
Vadim Zeitlin
7cc94808b6 Extend std::auto_ptr<> support to Ruby
This is trivial as exactly the same typemap as for Python can be used
for Ruby too, all the differenced are abstracted by the unified typemap
library.
2020-01-17 15:09:17 +01:00
Julien Schueller
96c6bf4cc2 Fix unused-parameter warning in pycontainer.swg 2020-01-17 11:09:57 +01:00
William S Fulton
7051753fdf Correct recently expanded testcase from a merge for doxygen default parameter support 2020-01-16 19:49:16 +00:00
William S Fulton
3585ee23cf Fix sort order of doxygen testcases 2020-01-16 19:37:07 +00:00
William S Fulton
bdc9aa0038 Update anther newly merged doxygen Java test for Java 9 API
See 66a7826192
2020-01-16 19:30:44 +00:00
William S Fulton
6e240e8fba Fix segfault parsing varargs with -doxygen
Closes #1643
2020-01-16 19:16:35 +00:00
William S Fulton
aa59c81205 Merge branch 'Issue-1643'
* Issue-1643:
  Fix pydoc null pointer dereference with missing arg type
2020-01-16 18:54:47 +00:00
William S Fulton
19e7648d25 Add changes entries for recent doxygen improvements 2020-01-16 07:51:06 +00:00