[svn:parrot] r48326 - trunk/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Thu Aug 5 07:10:05 UTC 2010


Author: NotFound
Date: Thu Aug  5 07:10:05 2010
New Revision: 48326
URL: https://trac.parrot.org/parrot/changeset/48326

Log:
instantiate class with null arg and call set_integer_native on the instance instead of instantiate using a temporary Integer in Parrot_pmc_new_init_int

Modified:
   trunk/src/pmc.c

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c	Thu Aug  5 06:30:27 2010	(r48325)
+++ trunk/src/pmc.c	Thu Aug  5 07:10:05 2010	(r48326)
@@ -573,10 +573,9 @@
     PMC *const classobj = interp->vtables[base_type]->pmc_class;
 
     if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) {
-        PMC * const initial =
-          Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer));
-        VTABLE_set_integer_native(interp, initial, init);
-        return VTABLE_instantiate(interp, classobj, initial);
+        PMC * const obj = VTABLE_instantiate(interp, classobj, PMCNULL);
+        VTABLE_set_integer_native(interp, obj, init);
+        return obj;
     }
     else {
         PMC * const pmc = get_new_pmc_header(interp, base_type, 0);


More information about the parrot-commits mailing list