Fixed bug in typemaps which caused derived_byvalue and rname test cases to fail.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9648 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8b334887e4
commit
e38a14b2df
3 changed files with 72 additions and 13 deletions
|
|
@ -31,11 +31,61 @@ struct Bar {
|
|||
|
||||
if the derived class is deleted, it works again
|
||||
|
||||
if the previos Foo::method
|
||||
if the previous Foo::method is deleted, it works again
|
||||
|
||||
*/
|
||||
struct DerFoo : Foo {
|
||||
};
|
||||
|
||||
/*
|
||||
The problem is caused by accidentally remembering a object value type
|
||||
instead of an object pointer type.
|
||||
During the course of SWIGing a file, several calls to SwigType_remember()
|
||||
or SwigType_remember_clientdata() will be made.
|
||||
When the SwigType_emit_type_table() function is called it emits all the
|
||||
type conversion functions.
|
||||
|
||||
If a object type exists in the SwigType table, you get this error.
|
||||
|
||||
You can view the SwigType table, with a #define DEBUG at the top of
|
||||
Source/Swig/typesys.c
|
||||
|
||||
When run you get an output like this:
|
||||
|
||||
---r_mangled---
|
||||
Hash {
|
||||
'_p_Bar' : Hash {
|
||||
'p.Bar' : _p_Bar,
|
||||
}
|
||||
,
|
||||
'_p_DerFoo' : Hash {
|
||||
'p.DerFoo' : _p_DerFoo,
|
||||
}
|
||||
,
|
||||
'_p_Foo' : Hash {
|
||||
'r.Foo' : _p_Foo,
|
||||
'p.Foo' : _p_Foo,
|
||||
}
|
||||
,
|
||||
'_Foo' : Hash {
|
||||
'Foo' : _Foo,
|
||||
}
|
||||
,
|
||||
}
|
||||
....
|
||||
|
||||
The last field ('_Foo') is an object type and caused the error.
|
||||
It can be fixed either by checking all the calls to SwigType_remember()
|
||||
and by checking the typemaps.
|
||||
The typemap code also calls SwigType_remember(), if your typemaps
|
||||
defined an object type, it will be added into the SwigType table.
|
||||
its normally a
|
||||
SWIG_ConvertPtr(....$descriptor...)
|
||||
when it should have been a $&descriptor or $*descriptor
|
||||
|
||||
Commenting out all your object typemaps (and typecheck fns) may help
|
||||
isolate it.
|
||||
|
||||
*/
|
||||
#
|
||||
%}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue