Restore containers accepting NULL pointers when used in overloaded methods - problem reported by Josh Cherry
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10217 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
5ad2a3ab0c
commit
76229dbab8
3 changed files with 12 additions and 1 deletions
|
|
@ -135,5 +135,7 @@ std::string overloaded1(std::vector<double> vi) { return "vector<double>"; }
|
||||||
std::string overloaded1(std::vector<int> vi) { return "vector<int>"; }
|
std::string overloaded1(std::vector<int> vi) { return "vector<int>"; }
|
||||||
std::string overloaded2(std::vector<int> vi) { return "vector<int>"; }
|
std::string overloaded2(std::vector<int> vi) { return "vector<int>"; }
|
||||||
std::string overloaded2(std::vector<double> vi) { return "vector<double>"; }
|
std::string overloaded2(std::vector<double> vi) { return "vector<double>"; }
|
||||||
|
std::string overloaded3(std::vector<int> *vi) { return "vector<int> *"; }
|
||||||
|
std::string overloaded3(int i) { return "int"; }
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,3 +124,12 @@ if overloaded2(iv) != "vector<int>":
|
||||||
if overloaded2(dv) != "vector<double>":
|
if overloaded2(dv) != "vector<double>":
|
||||||
raise RuntimeError
|
raise RuntimeError
|
||||||
|
|
||||||
|
if overloaded3(iv) != "vector<int> *":
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
if overloaded3(None) != "vector<int> *":
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
if overloaded3(100) != "int":
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -702,7 +702,7 @@ namespace swig {
|
||||||
typedef T value_type;
|
typedef T value_type;
|
||||||
|
|
||||||
static int asptr(PyObject *obj, sequence **seq) {
|
static int asptr(PyObject *obj, sequence **seq) {
|
||||||
if (SWIG_Python_GetSwigThis(obj)) {
|
if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) {
|
||||||
sequence *p;
|
sequence *p;
|
||||||
if (SWIG_ConvertPtr(obj,(void**)&p,
|
if (SWIG_ConvertPtr(obj,(void**)&p,
|
||||||
swig::type_info<sequence>(),0) == SWIG_OK) {
|
swig::type_info<sequence>(),0) == SWIG_OK) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue