Fix some subtle named output typemap lookup misses, the fully qualified name was not always being in all cases such as member variables

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13878 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2012-11-13 22:16:28 +00:00
commit 421139a5fe
7 changed files with 62 additions and 13 deletions

View file

@ -3514,7 +3514,6 @@ public:
* --------------------------------------------------------------- */
int classDirectorMethod(Node *n, Node *parent, String *super) {
String *empty_str = NewString("");
String *classname = Getattr(parent, "sym:name");
String *c_classname = Getattr(parent, "name");
String *name = Getattr(n, "name");
@ -3625,8 +3624,7 @@ public:
String *cdesc = NULL;
SwigType *covariant = Getattr(n, "covariant");
SwigType *adjustedreturntype = covariant ? covariant : returntype;
Parm *adjustedreturntypeparm = NewParm(adjustedreturntype, name, n);
// Setattr(adjustedreturntypeparm, "sym:symtab", Getattr(n, "sym:symtab"));
Parm *adjustedreturntypeparm = NewParmNode(adjustedreturntype, n);
if ((tm = Swig_typemap_lookup("directorin", adjustedreturntypeparm, "", 0))
&& (cdesc = Getattr(adjustedreturntypeparm, "tmap:directorin:descriptor"))) {
@ -3646,7 +3644,7 @@ public:
/* Get the JNI field descriptor for this return type, add the JNI field descriptor
to jniret_desc */
if ((c_ret_type = Swig_typemap_lookup("jni", n, "", 0))) {
Parm *tp = NewParm(c_ret_type, name, n);
Parm *tp = NewParmNode(c_ret_type, n);
if (!is_void && !ignored_method) {
String *jretval_decl = NewStringf("%s jresult", c_ret_type);
@ -3737,7 +3735,7 @@ public:
}
/* Start the Java field descriptor for the intermediate class's upcall (insert self object) */
Parm *tp = NewParm(c_classname, empty_str, n);
Parm *tp = NewParmNode(c_classname, n);
String *jdesc;
if ((tm = Swig_typemap_lookup("directorin", tp, "", 0))
@ -3779,7 +3777,7 @@ public:
/* Get parameter's intermediary C type */
if ((c_param_type = Getattr(p, "tmap:jni"))) {
Parm *tp = NewParm(c_param_type, empty_str, n);
Parm *tp = NewParm(c_param_type, Getattr(p, "name"), n);
String *desc_tm = NULL, *jdesc = NULL, *cdesc = NULL;
/* Add to local variables */

View file

@ -1419,7 +1419,12 @@ int Language::membervariableHandler(Node *n) {
target = NewStringf("%s->%s", pname, name);
Delete(pname);
}
tm = Swig_typemap_lookup("memberin", n, target, 0);
// This is an input type typemap lookup and so it should not use Node n
// otherwise qualification is done on the parameter name for the setter function
Parm *nin = NewParm(type, name, n);
tm = Swig_typemap_lookup("memberin", nin, target, 0);
Delete(nin);
}
int flags = Extend | SmartPointer | use_naturalvar_mode(n);
if (isNonVirtualProtectedAccess(n))

View file

@ -682,7 +682,7 @@ String * R::createFunctionPointerHandler(SwigType *t, Node *n, int *numArgs) {
XXX Have to be a little more clever so that we can deal with struct A * - the * is getting lost.
Is this still true? If so, will a SwigType_push() solve things?
*/
Parm *bbase = NewParm(rettype, Swig_cresult_name(), n);
Parm *bbase = NewParmNode(rettype, n);
String *returnTM = Swig_typemap_lookup("in", bbase, Swig_cresult_name(), f);
if(returnTM) {
String *tm = returnTM;