fix python bindings for spot::parsed_formula::f getter

* python/spot/impl.i: Add a typemap.
* tests/python/ltlsimple.py: Add a test case for an issue.
* NEWS: Mention the bug.
This commit is contained in:
Alexandre Duret-Lutz 2018-08-02 23:05:22 +02:00
parent 23722c031f
commit 8a26744720
3 changed files with 21 additions and 0 deletions

View file

@ -386,6 +386,15 @@ namespace swig
SWIG_POINTER_IMPLICIT_CONV));
}
// Access to stucture members, such as spot::parsed_formula::f are done via
// the pointer typemap. We want to enforce a copy.
%typemap(out) spot::formula* {
if (!*$1)
$result = SWIG_Py_Void();
else
$result = SWIG_NewPointerObj(new spot::formula(*$1), $descriptor(spot::formula*), SWIG_POINTER_OWN);
}
%typemap(out) spot::formula {
if (!$1)
$result = SWIG_Py_Void();