[svn:parrot] r38058 - branches/packfile_revamp/src/pmc

bacek at svn.parrot.org bacek at svn.parrot.org
Sat Apr 11 08:14:24 UTC 2009


Author: bacek
Date: Sat Apr 11 08:14:24 2009
New Revision: 38058
URL: https://trac.parrot.org/parrot/changeset/38058

Log:
Distinguish Keys from other PMCs in PackfileConstantTable.set_pmc_keyed_int.

Modified:
   branches/packfile_revamp/src/pmc/packfileconstanttable.pmc

Modified: branches/packfile_revamp/src/pmc/packfileconstanttable.pmc
==============================================================================
--- branches/packfile_revamp/src/pmc/packfileconstanttable.pmc	Sat Apr 11 08:14:01 2009	(r38057)
+++ branches/packfile_revamp/src/pmc/packfileconstanttable.pmc	Sat Apr 11 08:14:24 2009	(r38058)
@@ -260,15 +260,17 @@
 
 =cut
 
-TODO: Distinguish between Key and other PMCs.
-
 */
     VTABLE void set_pmc_keyed_int(INTVAL index, PMC *value)  {
         Parrot_PackfileConstantTable_attributes * attrs =
                 PARROT_PACKFILECONSTANTTABLE(SELF);
+        opcode_t type = VTABLE_isa(interp, value,
+                Parrot_str_new_constant(interp, "Key"))
+                ? PFC_KEY
+                : PFC_PMC;
 
         VTABLE_set_pmc_keyed_int(interp, attrs->constants,  index, value);
-        VTABLE_set_integer_keyed_int(interp, attrs->types, index, PFC_PMC);
+        VTABLE_set_integer_keyed_int(interp, attrs->types, index, type);
     }
 
 


More information about the parrot-commits mailing list