Author: miguel
Date: 2006-10-17 19:29:36 -0400 (Tue, 17 Oct 2006)
New Revision: 66772
Modified:
trunk/mono/eglib/ChangeLog
trunk/mono/eglib/src/garray.c
trunk/mono/eglib/test/array.c
Log:
2006-10-17 Miguel de Icaza <[EMAIL PROTECTED]>
* src/garray.c (g_array_insert_vals): Shift the elements the
correct amount.
Modified: trunk/mono/eglib/ChangeLog
===================================================================
--- trunk/mono/eglib/ChangeLog 2006-10-17 23:20:14 UTC (rev 66771)
+++ trunk/mono/eglib/ChangeLog 2006-10-17 23:29:36 UTC (rev 66772)
@@ -1,6 +1,9 @@
2006-10-17 Miguel de Icaza <[EMAIL PROTECTED]>
- * src/garray.c (g_array_insert_vals): Should actually use the
+ * src/garray.c (g_array_insert_vals): Shift the elements the
+ correct amount.
+
+ (g_array_insert_vals): Should actually use the
number of elements to insert.
* test/array.c: Add new test case, this was happening in the JIT.
Modified: trunk/mono/eglib/src/garray.c
===================================================================
--- trunk/mono/eglib/src/garray.c 2006-10-17 23:20:14 UTC (rev 66771)
+++ trunk/mono/eglib/src/garray.c 2006-10-17 23:29:36 UTC (rev 66772)
@@ -132,7 +132,7 @@
/* first move the existing elements out of the way */
memmove (element_offset (priv, index_ + len),
element_offset (priv, index_),
- element_length (priv, len - index_));
+ element_length (priv, array->len - index_));
/* then copy the new elements into the array */
memmove (element_offset (priv, array->len),
Modified: trunk/mono/eglib/test/array.c
===================================================================
--- trunk/mono/eglib/test/array.c 2006-10-17 23:20:14 UTC (rev 66771)
+++ trunk/mono/eglib/test/array.c 2006-10-17 23:29:36 UTC (rev 66772)
@@ -93,6 +93,9 @@
if (array != g_array_index (array, gpointer, 0))
return FAILED ("The value in the array is incorrect");
+ g_array_insert_val (array, 1, array);
+ g_array_insert_val (array, 2, array);
+
g_array_free (array, TRUE);
return NULL;
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches