#760 Uncompilable dispatch method with %typemap(in)

closed-fixed
perl (97)
5
2006-10-27
2006-10-27
No

The attached bug.i file, swigged with -c++ -perl5,
creates an uncompilable code.

The %typemap(in) has a subtle typo -
there's "numinput=0" instead of "numinputs=0". The
generated dispatch function for the overload cases
contains
int res = SWIG_ConvertPtr(argv[3], &vptr,
SWIGTYPE_p_p_char, 0);

It accesses ST(0), ST(1) and ST(2) correctly. Then it
tries to check the fourth parameter (why oh why?) and
gets somewhat confused about it - and it uses non-
existent variable "argv"...

I expect Swig either complain about syntactically
incorrect typemap specification, or to generate a
code that compiles.

Tested with swig 1.3.29.

Discussion

  • Petr Novotny

    Petr Novotny - 2006-10-27

    Demonstration file

     
  • Olly Betts

    Olly Betts - 2006-10-27
    • assigned_to: nobody --> olly
    • status: open --> closed-fixed
     
  • Olly Betts

    Olly Betts - 2006-10-27

    Logged In: YES
    user_id=14972

    Thanks for your bug report.

    I believe I recently fixed the "argv" problem in CVS HEAD -
    the generated code I get with your example doesn't reference
    argv with CVS HEAD.

    The reason that 4 parameters appear to be checked is that
    ST(0) is actually the "this" pointer to the object itself -
    if you look carefully at the code, it is expected to be a
    "pointer to B".

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks