[svn:parrot] r40972 - trunk/src/pmc

NotFound at svn.parrot.org NotFound at svn.parrot.org
Fri Sep 4 18:39:53 UTC 2009


Author: NotFound
Date: Fri Sep  4 18:39:53 2009
New Revision: 40972
URL: https://trac.parrot.org/parrot/changeset/40972

Log:
[pmc] fix? HashIteratorKey.get_string

Modified:
   trunk/src/pmc/hashiteratorkey.pmc

Modified: trunk/src/pmc/hashiteratorkey.pmc
==============================================================================
--- trunk/src/pmc/hashiteratorkey.pmc	Fri Sep  4 18:35:35 2009	(r40971)
+++ trunk/src/pmc/hashiteratorkey.pmc	Fri Sep  4 18:39:53 2009	(r40972)
@@ -44,21 +44,23 @@
         Parrot_HashIteratorKey_attributes *attrs =
                 PARROT_HASHITERATORKEY(SELF);
 
-        switch (attrs->parrot_hash->key_type) {
-            case Hash_key_type_int:
-                return Parrot_str_from_int(INTERP, (INTVAL)attrs->bucket->key);
-
-            case Hash_key_type_STRING:
-                return (STRING*)attrs->bucket->key;
-
-            case Hash_key_type_PMC:
-                return VTABLE_get_string(INTERP, (PMC *)attrs->bucket->key);
-
-            default:
-                /* Horribly die? */
-                break;
+        if (attrs->parrot_hash) {
+            switch (attrs->parrot_hash->key_type) {
+                case Hash_key_type_int:
+                    return Parrot_str_from_int(INTERP, (INTVAL)attrs->bucket->key);
+
+                case Hash_key_type_STRING:
+                    return (STRING*)attrs->bucket->key;
+
+                case Hash_key_type_PMC:
+                    return VTABLE_get_string(INTERP, (PMC *)attrs->bucket->key);
+
+                default:
+                    break;
+            }
         }
 
+        /* Horribly die? */
         return NULL;
     }
 


More information about the parrot-commits mailing list