[svn:parrot] r44274 - branches/boehm_gc_2/lib/Parrot/Pmc2c

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Feb 21 06:45:15 UTC 2010


Author: bacek
Date: Sun Feb 21 06:45:14 2010
New Revision: 44274
URL: https://trac.parrot.org/parrot/changeset/44274

Log:
Fix generating attr_layout for arrays

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

Modified: branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm
==============================================================================
--- branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm	Sun Feb 21 06:44:45 2010	(r44273)
+++ branches/boehm_gc_2/lib/Parrot/Pmc2c/PMCEmitter.pm	Sun Feb 21 06:45:14 2010	(r44274)
@@ -1165,8 +1165,18 @@
     my $bit = 1;
     use Data::Dumper;
     for my $attr (@{$self->attributes}) {
-        $result |= $bit if ($attr->{type} =~ m{\*$});
-        $bit *= 2;
+        $result |= $bit if $attr->{type} =~ m{\*$};
+
+        # CallContext struct.
+        $result |= $bit if $attr->{type} =~ m{^Regs};
+
+        if ($attr->{array_size}) {
+            my ($as) = $attr->{array_size} =~ m{ (\d+) }x;
+            $bit *= (2 ** $as);
+        }
+        else {
+            $bit *= 2;
+        }
     }
     #warn sprintf("%b %s\n", $result, Dumper($self->attributes));
 


More information about the parrot-commits mailing list