Author: chromatic
Date: Tue Oct 2 14:20:41 2007
New Revision: 21761
Modified:
branches/pdd15oo/src/pmc/resizablepmcarray.pmc
branches/pdd15oo/t/op/calling.t
branches/pdd15oo/t/pmc/capture.t
Log:
[PMC] ResizablePMCArray now returns PMCNULL instead of Undef when accessing a
non-existent element.
The commits to the test files work around this change. A few more tests fail,
but they'll be easy to fix:
t/examples/shootout.t 3 768 20 3 3 7 18
t/library/dumper.t 1 256 26 1 13
t/pmc/exception.t 6 1536 29 6 8-9 13-15 26
t/pmc/resizablepmcarray.t 1 256 38 1 9
Modified: branches/pdd15oo/src/pmc/resizablepmcarray.pmc
==============================================================================
--- branches/pdd15oo/src/pmc/resizablepmcarray.pmc (original)
+++ branches/pdd15oo/src/pmc/resizablepmcarray.pmc Tue Oct 2 14:20:41 2007
@@ -208,7 +208,7 @@
data = PMC_data_typed(SELF, PMC **);
if (PMC_IS_NULL(data[key]))
- data[key] = pmc_new(INTERP, enum_class_Undef);
+ data[key] = PMCNULL;
return data[key];
}
Modified: branches/pdd15oo/t/op/calling.t
==============================================================================
--- branches/pdd15oo/t/op/calling.t (original)
+++ branches/pdd15oo/t/op/calling.t Tue Oct 2 14:20:41 2007
@@ -313,8 +313,10 @@
print S0
set S0, P2[4]
print S0
- set S0, P2[5]
- print S0
+ set P0, P2[5]
+ if_null P0, ok
+ print "not ok 7\n"
+ ok:
returncc
CODE
ok 1
Modified: branches/pdd15oo/t/pmc/capture.t
==============================================================================
--- branches/pdd15oo/t/pmc/capture.t (original)
+++ branches/pdd15oo/t/pmc/capture.t Tue Oct 2 14:20:41 2007
@@ -237,7 +237,7 @@
0 0
1 1
1 1
-0 1
+0 0
0 1
0 0
0 0
@@ -275,7 +275,7 @@
/get_number\(\) not implemented in class 'Capture'/
OUT
-pir_output_is( <<'CODE', <<'OUTPUT', '*_keyed_int delegation', todo => "Fix
objects vs. vtables" );
+pir_output_is( <<'CODE', <<'OUTPUT', '*_keyed_int delegation' );
.sub main :main
$P99 = subclass 'Capture', 'Match'
$P1 = new 'Match'