[svn:parrot] r40478 - branches/auto_attrs/lib/Parrot/Pmc2c

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Aug 10 13:19:28 UTC 2009


Author: NotFound
Date: Mon Aug 10 13:19:25 2009
New Revision: 40478
URL: https://trac.parrot.org/parrot/changeset/40478

Log:
heuristic to allow non auto_attrs PMC inehriting from auto_attrs ones in corner cases

Modified:
   branches/auto_attrs/lib/Parrot/Pmc2c/PMCEmitter.pm

Modified: branches/auto_attrs/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/auto_attrs/lib/Parrot/Pmc2c/PMCEmitter.pm	Mon Aug 10 11:28:05 2009	(r40477)
+++ branches/auto_attrs/lib/Parrot/Pmc2c/PMCEmitter.pm	Mon Aug 10 13:19:25 2009	(r40478)
@@ -763,13 +763,16 @@
     my $classname = $self->name;
     my $export = $self->is_dynamic ? 'PARROT_DYNEXT_EXPORT ' : 'PARROT_EXPORT';
 
-    my $set_attr_size = "    vt->attr_size = ";
+    my $set_attr_size = '';
+
     if ( @{$self->attributes} && $self->{flags}{auto_attrs} ) {
         $set_attr_size .= "sizeof(Parrot_${classname}_attributes)";
     } else {
-        $set_attr_size .= "0";
+        $set_attr_size .= "0" if exists($self->{has_method}{init}) ||
+                                 exists($self->{has_method}{init_pmc});
     }
-    $set_attr_size .= ";\n";
+    $set_attr_size =     "    vt->attr_size = " . $set_attr_size . ";\n"
+        if $set_attr_size ne '';
 
     my $vtable_updates = '';
     for my $name ( @{ $self->vtable->names } ) {


More information about the parrot-commits mailing list