Преглед на файлове

2003-06-15 Zoltan Varga <[email protected]>

	* gc.c: Start GCHandle indexes from 1, since 0 means the handle is
	not allocated.

svn path=/trunk/mono/; revision=15415
Zoltan Varga преди 22 години
родител
ревизия
da09ce129c
променени са 2 файла, в които са добавени 6 реда и са изтрити 1 реда
  1. 4 0
      mono/metadata/ChangeLog
  2. 2 1
      mono/metadata/gc.c

+ 4 - 0
mono/metadata/ChangeLog

@@ -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]>
 

+ 2 - 1
mono/metadata/gc.c

@@ -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;