[svn:parrot] r35613 - in branches/morph_pmc_type/languages: lua/src/pmc regex/pmc

[email protected]
Newsgroups perl.cvs.parrot
Message-ID <[email protected]>
Author: Whiteknight
Date: Thu Jan 15 17:34:46 2009
New Revision: 35613

Modified:
   branches/morph_pmc_type/languages/lua/src/pmc/luaany.pmc
   branches/morph_pmc_type/languages/regex/pmc/matchrange.pmc

Log:
[morph_pmc_type] a few stragglers

Modified: branches/morph_pmc_type/languages/lua/src/pmc/luaany.pmc
==============================================================================
--- branches/morph_pmc_type/languages/lua/src/pmc/luaany.pmc	(original)
+++ branches/morph_pmc_type/languages/lua/src/pmc/luaany.pmc	Thu Jan 15 17:34:46 2009
@@ -140,7 +140,7 @@
 
 */
     VTABLE void assign_pmc(PMC *value) {
-        VTABLE_morph(INTERP, SELF, PMC_type(value));
+        VTABLE_morph_string(INTERP, SELF, value->vtable->whoami);
         if (PMC_type(value) != dynpmc_LuaNil)
             SELF.set_pmc(value);
     }

Modified: branches/morph_pmc_type/languages/regex/pmc/matchrange.pmc
==============================================================================
--- branches/morph_pmc_type/languages/regex/pmc/matchrange.pmc	(original)
+++ branches/morph_pmc_type/languages/regex/pmc/matchrange.pmc	Thu Jan 15 17:34:46 2009
@@ -131,6 +131,12 @@
             return;
         SUPER(type);
     }
+    
+    void morph_string(STRING *type) {
+        if (SELF->vtable->base_type == pmc_type(interp, type))
+            return;
+        SUPER(type);
+    }
 
     PMC* clone() {
         PMC* dest = pmc_new_noinit(interp, SELF->vtable->base_type);
@@ -365,7 +371,7 @@
 
     PMC* add_int(INTVAL value, PMC* dest) {
         if (dest)
-            VTABLE_morph(interp, dest, MatchRange_type_id);
+            VTABLE_morph_string(interp, dest, MatchRange_type_id);
         else
             dest = pmc_new(interp,  MatchRange_type_id);
         if (RANGE_END(SELF) == -2) {
@@ -406,7 +412,7 @@
 
     PMC* subtract_int(INTVAL value, PMC* dest) {
         if (dest)
-            VTABLE_morph(interp, dest, MatchRange_type_id);
+            VTABLE_morph_string(interp, dest, interp->vtables[MatchRange_type_id]->whoami);
         else
             dest = pmc_new(interp,  MatchRange_type_id);
         RANGE_END(dest) = RANGE_END(SELF) - value;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.