key.c:
  intialize KEY.keys

classes/perlarray.c:
 * get_string: is casting SELF->cache.struct_val to a STRING*,
   while all other methods are using it as a KEY*; don't know
   what a perlarray stringifies to, so replacing with NULL
 * get_bool: the default behaviour does not look right to me

after the patch

All tests successful (1 subtest UNEXPECTEDLY SUCCEEDED), 3 subtests skipped.
Files=17, Tests=292, 206 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

Win2k, MSVC5, Configure.pl --debugging --defaults

Regards
Mattia

Index: key.c
===================================================================
RCS file: /home/perlcvs/parrot/key.c,v
retrieving revision 1.14
diff -u -2 -r1.14 key.c
--- key.c       12 Jan 2002 15:33:08 -0000      1.14
+++ key.c       13 Jan 2002 18:40:11 -0000
@@ -122,4 +122,6 @@
 
   key->size = 0;
+  key->keys = 0;
+
   return key;
 }
Index: classes/perlarray.pmc
===================================================================
RCS file: /home/perlcvs/parrot/classes/perlarray.pmc,v
retrieving revision 1.5
diff -u -2 -r1.5 perlarray.pmc
--- classes/perlarray.pmc       10 Jan 2002 22:30:13 -0000      1.5
+++ classes/perlarray.pmc       13 Jan 2002 18:40:12 -0000
@@ -78,5 +78,5 @@
 
     STRING* get_string () {
-       return (STRING*)SELF->cache.struct_val;
+       return NULL;
     }
 
@@ -87,5 +87,9 @@
     }
 
-    BOOLVAL get_bool () = default;
+    BOOLVAL get_bool () {
+       KEY* key = SELF->cache.struct_val;
+       INTVAL size = key_size(INTERP,key);
+       return (size != 0);
+    }
 
     void* get_value () {

Reply via email to