[svn:parrot] r48932 - in trunk: lib/Parrot/Pmc2c src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Sat Sep 11 15:26:13 UTC 2010


Author: NotFound
Date: Sat Sep 11 15:26:13 2010
New Revision: 48932
URL: https://trac.parrot.org/parrot/changeset/48932

Log:
add a check for duplicated VTABLE functions in PMCs and remove two duplicates found while tesing it

Modified:
   trunk/lib/Parrot/Pmc2c/PMC.pm
   trunk/src/pmc/oplib.pmc
   trunk/src/pmc/resizablestringarray.pmc

Modified: trunk/lib/Parrot/Pmc2c/PMC.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC.pm	Sat Sep 11 14:22:58 2010	(r48931)
+++ trunk/lib/Parrot/Pmc2c/PMC.pm	Sat Sep 11 15:26:13 2010	(r48932)
@@ -71,6 +71,8 @@
 # methods
 sub add_method {
     my ( $self, $method ) = @_;
+    die "FATAL ERROR: Duplicated VTABLE function: " . $method->name
+        if exists $self->{has_method}{$method->name};
     $self->{has_method}{ $method->name } = @{ $self->{methods} };
     push @{ $self->{methods} }, $method;
 }

Modified: trunk/src/pmc/oplib.pmc
==============================================================================
--- trunk/src/pmc/oplib.pmc	Sat Sep 11 14:22:58 2010	(r48931)
+++ trunk/src/pmc/oplib.pmc	Sat Sep 11 15:26:13 2010	(r48932)
@@ -116,10 +116,6 @@
         return STATICSELF.elements();
     }
 
-    VTABLE INTVAL get_integer() {
-        return STATICSELF.elements();
-    }
-
     METHOD op_family(STRING *shortname)
     {
         char * const sname = Parrot_str_to_cstring(INTERP, shortname);

Modified: trunk/src/pmc/resizablestringarray.pmc
==============================================================================
--- trunk/src/pmc/resizablestringarray.pmc	Sat Sep 11 14:22:58 2010	(r48931)
+++ trunk/src/pmc/resizablestringarray.pmc	Sat Sep 11 15:26:13 2010	(r48932)
@@ -302,25 +302,6 @@
 
 /*
 
-=item C<PMC *shift_pmc()>
-
-Removes and returns the first element in the array.
-
-=cut
-
-*/
-
-    VTABLE PMC *shift_pmc() {
-        STRING * const strval = SELF.shift_string();
-        PMC    * const value  = Parrot_pmc_new(INTERP, enum_class_String);
-
-        VTABLE_set_string_native(INTERP, value, strval);
-
-        return value;
-    }
-
-/*
-
 =item C<INTVAL shift_integer()>
 
 Removes and returns the first element in the array.


More information about the parrot-commits mailing list