cvsuser 05/02/18 05:41:27
Modified: classes resizablepmcarray.pmc
imcc pbc.c
Log:
some fixes
* add missing vtable push_string
* fix off by one error
Revision Changes Path
1.19 +16 -2 parrot/classes/resizablepmcarray.pmc
Index: resizablepmcarray.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/resizablepmcarray.pmc,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- resizablepmcarray.pmc 27 Jan 2005 07:59:58 -0000 1.18
+++ resizablepmcarray.pmc 18 Feb 2005 13:41:26 -0000 1.19
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: resizablepmcarray.pmc,v 1.18 2005/01/27 07:59:58 leo Exp $
+$Id: resizablepmcarray.pmc,v 1.19 2005/02/18 13:41:26 leo Exp $
=head1 NAME
@@ -206,6 +206,8 @@
=item C<void push_integer(INTVAL value)>
+=item C<void push_string(INTVAL value)>
+
Extends the array by adding an element of value C<*value> to the end of
the array.
@@ -216,7 +218,7 @@
void push_integer(INTVAL value) {
PMC *val;
INTVAL size;
-
+
size = PMC_int_val(SELF);
val = pmc_new(INTERP, enum_class_Integer);
VTABLE_set_integer_native(INTERP, val, value);
@@ -226,6 +228,18 @@
return;
}
+ void push_string(STRING* value) {
+ PMC *val;
+ INTVAL size;
+
+ size = PMC_int_val(SELF);
+ val = pmc_new(INTERP, enum_class_String);
+ VTABLE_assign_string_native(INTERP, val, value);
+ /* let set_pmc_keyed_int() worry about memory allocation */
+ DYNSELF.set_pmc_keyed_int(size, val);
+
+ return;
+ }
/*
=item C<PMC *clone()>
1.107 +1 -1 parrot/imcc/pbc.c
Index: pbc.c
===================================================================
RCS file: /cvs/public/parrot/imcc/pbc.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- pbc.c 3 Feb 2005 07:59:30 -0000 1.106
+++ pbc.c 18 Feb 2005 13:41:27 -0000 1.107
@@ -944,7 +944,7 @@
/* FIXME length and multiple subs */
debug_seg = Parrot_new_debug_seg(interpreter,
interpreter->code->cur_cs, sourcefile,
- (size_t) ins_line+ins_size);
+ (size_t) ins_line + ins_size + 1);
}
else
debug_seg = NULL;