SourceForge.net | 12 Aug 16:49
Favicon
Gravatar

[ swig-Bugs-2048064 ] [ruby] aliases broken with -minherit

Bugs item #2048064, was opened at 2008-08-12 09:50
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2048064&group_id=1645

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: ruby
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Evan Wies (neomantra)
Assigned to: Gonzalo Garramuno (gga73)
Summary: [ruby] aliases broken with -minherit

Initial Comment:
It appears that %alias is broken with the -minherit flag.

I discovered it when binding a vector. One way that this elicits itself is that the STL vector bindings use
%alias.  It will segfault in registration with a NameError relating to reject!

AFACS, this stl binding broke on Ruby between 1.3.29 and 1.3.33, since the newer binding uses some ruby
aliases.  (I use Ubuntu and one version is Dapper's and the other is Hardy's)

The fix is pretty simple (this is against 1.3.36, but is equally applicable to other versions):

--- Source/Modules/ruby.cxx.old    2008-08-12 10:49:03.000000000 -0400
+++ Source/Modules/ruby.cxx     2008-08-12 10:20:40.000000000 -0400
@@ -1234,7 +1234,11 @@
        Iterator alias = First(aliases);
        while (alias.item) {
          if (Len(alias.item) > 0) {
-           Printv(klass->init, tab4, "rb_define_alias(", klass->vname, ", \"", alias.item, "\", \"", iname,
"\");\n", NIL);
+           if (multipleInheritance) {
+             Printv(klass->init, tab4, "rb_define_alias(", klass->mImpl, ", \"", alias.item, "\", \"", iname,
"\");\n", NIL);
+           } else {
+             Printv(klass->init, tab4, "rb_define_alias(", klass->vname, ", \"", alias.item, "\", \"", iname,
"\");\n", NIL);
+           }
          }
          alias = Next(alias);
        }

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=101645&aid=2048064&group_id=1645

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane