Lyle Johnson | 1 Sep 2002 16:51

[Swig-CVS] commit 'SWIG/Examples/test-suite/ruby smart_pointer_multi_runme.rb smart_pointer_multi_typedef_runme.rb smart_pointer_not_runme.rb smart_pointer_overload_runme.rb smart_pointer_rename_runme.rb smart_pointer_simple_runme.rb smart_pointer_typedef_runme.rb'

Sun Sep  1 09:51:22 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite/ruby
In directory schlitz:/tmp/cvs-serv6238

Added Files:
      Tag: rel-1-3
	smart_pointer_multi_runme.rb 
	smart_pointer_multi_typedef_runme.rb 
	smart_pointer_not_runme.rb smart_pointer_overload_runme.rb 
	smart_pointer_rename_runme.rb smart_pointer_simple_runme.rb 
	smart_pointer_typedef_runme.rb 
Log Message:
Added smart pointer test case run test scripts for Ruby.

Lyle Johnson | 1 Sep 2002 16:57

[Swig-CVS] commit 'SWIG/Examples/test-suite/ruby smart_pointer_const_runme.rb'

Sun Sep  1 09:57:18 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite/ruby
In directory schlitz:/tmp/cvs-serv6249

Added Files:
      Tag: rel-1-3
	smart_pointer_const_runme.rb 
Log Message:

Lyle Johnson | 1 Sep 2002 17:00

[Swig-CVS] commit 'SWIG/Examples/test-suite/ruby smart_pointer_not_runme.rb'

Sun Sep  1 10:00:07 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite/ruby
In directory schlitz:/tmp/cvs-serv6260

Modified Files:
      Tag: rel-1-3
	smart_pointer_not_runme.rb 
Log Message:

noreply | 1 Sep 2002 19:24
Picon
Favicon

[ swig-Bugs-603199 ] SWIG_ConvertPtr returns the same pointer

Bugs item #603199, was opened at 2002-09-01 10:24
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=603199&group_id=1645

Category: ruby
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Wong (chris_wong)
Assigned to: Nobody/Anonymous (nobody)
Summary: SWIG_ConvertPtr returns the same pointer

Initial Comment:

The following interface file can be used to test where Foo * is 
passed correctly to printFoo.  getValue should always be 100.  
However the test script shows that it prints out some garbage 
number.  And printFoo always get the same pointer (which seems 
to be a pointer to the class.)  Despite the fact that f and f2 are 
pointers to different Foo, it prints out the same address in 
printFoo.

Attached the generated file.

irb(main):001:0> require "footest"
true
irb(main):002:0> include Footest
Object
irb(main):003:0> f=createFoo
(Continue reading)

David Beazley | 1 Sep 2002 20:49
Favicon

Re: A devil case...

Marcelo Matus writes:
 > Another simpler version, with no namespace, does the same:
 > 
[ snip ]
 >    
 >   template <class ArgType, class ResType>        
 >     struct unary_func_traits
 >     {
 >     };   
 >  
 >   template <class ArgType>        
 >     struct unary_func_traits<ArgType, Real >
 >     {
 >       typedef UnaryFunction<ArgType, Real > base;
 >     }; 
 >  

[ snip ]

Okay, I did a little digging on this.  The bug is actually due to an
error in C++ template partial specialization matching.

When you instantiated unary_func_traits<Real,Real>, it was picking up
the template <class ArgType, class ResType> instead of the
specialization.  Since that version is missing the "base" typedef,
SWIG couldn't make the proper associations in the type system. 

I'm about to check in a parser.y patch that seems to fix the problem
is this case.  There are some other even more subtle bugs that are related
to this that I'm still sorting out. Please let me know if the patch
(Continue reading)

David M. Beazley | 1 Sep 2002 20:50

[Swig-CVS] commit 'SWIG/Source/CParse parser.y'

Sun Sep  1 13:50:57 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Source/CParse
In directory schlitz:/tmp/cvs-serv6322

Modified Files:
      Tag: rel-1-3
	parser.y 
Log Message:
Patch to template partial specialization registration.

Lyle Johnson | 2 Sep 2002 00:12

[Swig-CVS] commit 'SWIG/Examples/test-suite union_scope.i'

Sun Sep  1 17:12:23 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite
In directory schlitz:/tmp/cvs-serv6361

Modified Files:
      Tag: rel-1-3
	union_scope.i 
Log Message:
Added %warnfilters for union_scope.i test case.

Lyle Johnson | 2 Sep 2002 00:23

[Swig-CVS] commit 'SWIG/Examples/test-suite/ruby default_constructor_runme.rb'

Sun Sep  1 17:23:28 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite/ruby
In directory schlitz:/tmp/cvs-serv6371

Modified Files:
      Tag: rel-1-3
	default_constructor_runme.rb 
Log Message:
Fixed the default_constructor run test for Ruby so that it works correctly
under both Ruby 1.6 and 1.7.

Lyle Johnson | 2 Sep 2002 00:30

[Swig-CVS] commit 'SWIG/Examples/test-suite/ruby inherit_missing_runme.rb'

Sun Sep  1 17:30:41 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Examples/test-suite/ruby
In directory schlitz:/tmp/cvs-serv6384

Added Files:
      Tag: rel-1-3
	inherit_missing_runme.rb 
Log Message:
Added the inherit_missing run test for Ruby, currently broken (demonstrates
a bug).

Lyle Johnson | 2 Sep 2002 01:02

[Swig-CVS] commit 'SWIG/Lib/ruby rubydef.swg'

Sun Sep  1 18:02:38 CDT 2002
Files: %{sVv}
Update of /cvsroot/SWIG/Lib/ruby
In directory schlitz:/tmp/cvs-serv6397

Modified Files:
      Tag: rel-1-3
	rubydef.swg 
Log Message:
Fixed a bug in SWIG_ConvertPtr(), for the call to SWIG_TypeCast()
when no other type information provided.


Gmane