cvsuser 05/03/18 04:15:10
Modified: classes array.pmc intlist.pmc
include/parrot list.h
src list.c
Log:
fix #34476 Segfault doing splice on intlist
Revision Changes Path
1.93 +3 -2 parrot/classes/array.pmc
Index: array.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/array.pmc,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- array.pmc 12 Jan 2005 11:42:06 -0000 1.92
+++ array.pmc 18 Mar 2005 12:15:02 -0000 1.93
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: array.pmc,v 1.92 2005/01/12 11:42:06 leo Exp $
+$Id: array.pmc,v 1.93 2005/03/18 12:15:02 leo Exp $
=head1 NAME
@@ -975,7 +975,8 @@
void splice(PMC* value, INTVAL offset, INTVAL count) {
if (SELF->vtable->base_type != value->vtable->base_type)
internal_exception(1, "Type mismatch in splice");
- list_splice(INTERP, (List*) PMC_data(SELF), value, offset, count);
+ list_splice(INTERP, (List*) PMC_data(SELF),
+ (List *) PMC_data(value), offset, count);
}
/*
1.33 +3 -3 parrot/classes/intlist.pmc
Index: intlist.pmc
===================================================================
RCS file: /cvs/public/parrot/classes/intlist.pmc,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- intlist.pmc 12 Jan 2005 11:42:06 -0000 1.32
+++ intlist.pmc 18 Mar 2005 12:15:02 -0000 1.33
@@ -1,6 +1,6 @@
/*
Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
-$Id: intlist.pmc,v 1.32 2005/01/12 11:42:06 leo Exp $
+$Id: intlist.pmc,v 1.33 2005/03/18 12:15:02 leo Exp $
=head1 NAME
@@ -213,8 +213,8 @@
void splice(PMC* value, INTVAL offset, INTVAL count) {
if (SELF->vtable->base_type != value->vtable->base_type)
internal_exception(1, "Type mismatch in splice");
- list_splice(INTERP, (List*) PMC_struct_val(SELF), value,
- offset, count);
+ list_splice(INTERP, (List*) PMC_struct_val(SELF),
+ (List *)PMC_struct_val(value), offset, count);
}
PMC* slice (PMC* key, INTVAL f) {
1.18 +2 -2 parrot/include/parrot/list.h
Index: list.h
===================================================================
RCS file: /cvs/public/parrot/include/parrot/list.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- list.h 19 Aug 2004 13:46:14 -0000 1.17
+++ list.h 18 Mar 2005 12:15:09 -0000 1.18
@@ -3,7 +3,7 @@
* Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
* License: Artistic/GPL, see README and LICENSES for details
* CVS Info
- * $Id: list.h,v 1.17 2004/08/19 13:46:14 leo Exp $
+ * $Id: list.h,v 1.18 2005/03/18 12:15:09 leo Exp $
* Overview:
* list aka array routines for Parrot
* s. list.c for more
@@ -93,7 +93,7 @@
void * list_get(Interp *interpreter, List *list, INTVAL idx, int type);
void list_insert(Interp *interpreter, List *list, INTVAL idx, INTVAL
n_items);
void list_delete(Interp *interpreter, List *list, INTVAL idx, INTVAL
n_items);
-void list_splice(Interp *interpreter, List *list, PMC* value, INTVAL offset,
+void list_splice(Interp *interpreter, List *list, List* value, INTVAL offset,
INTVAL count);
#endif /* PARROT_LIST_H_GUARD */
1.55 +2 -3 parrot/src/list.c
Index: list.c
===================================================================
RCS file: /cvs/public/parrot/src/list.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- list.c 25 Feb 2005 09:33:07 -0000 1.54
+++ list.c 18 Mar 2005 12:15:10 -0000 1.55
@@ -1,7 +1,7 @@
/*
Copyright: (c) 2002 Leopold Toetsch <[EMAIL PROTECTED]>
License: Artistic/GPL, see README and LICENSES for details
-$Id: list.c,v 1.54 2005/02/25 09:33:07 leo Exp $
+$Id: list.c,v 1.55 2005/03/18 12:15:10 leo Exp $
=head1 NAME
@@ -1991,10 +1991,9 @@
*/
void
-list_splice(Interp *interpreter, List *list, PMC *value, INTVAL offset,
+list_splice(Interp *interpreter, List *list, List *value_list, INTVAL offset,
INTVAL count)
{
- List *value_list = value ? (List *)PMC_data(value): NULL;
INTVAL value_length = value_list ? value_list->length : 0;
INTVAL length = list->length;
INTVAL i, j;