* gc.c: Start GCHandle indexes from 1, since 0 means the handle is not allocated. svn path=/trunk/mono/; revision=15415
@@ -1,3 +1,7 @@
+2003-06-15 Zoltan Varga <[email protected]>
+
+ * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
+ not allocated.
Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <[email protected]>
@@ -321,7 +321,8 @@ ves_icall_System_GCHandle_GetTargetHandle (MonoObject *obj, guint32 handle, gint
MONO_ARCH_SAVE_REGS;
EnterCriticalSection (&handle_section);
- idx = next_handle++;
+ /* Indexes start from 1 since 0 means the handle is not allocated */
+ idx = ++next_handle;
if (idx >= array_size) {
#if HAVE_BOEHM_GC
gpointer *new_array;