Index: mono/jit/exception.c
===================================================================
RCS file: /mono/mono/mono/jit/exception.c,v
retrieving revision 1.6
diff -u -r1.6 exception.c
--- mono/jit/exception.c	30 Apr 2002 02:09:11 -0000	1.6
+++ mono/jit/exception.c	4 May 2002 20:43:02 -0000
@@ -171,7 +171,20 @@
 			for (i = 0; i < ji->num_clauses; i++) {
 				MonoJitExceptionInfo *ei = &ji->clauses [i];
 
-				if (ei->try_start <= ip && ip <= (ei->try_end)) { 
+				/* When making an x-86 CALL, the address of the instruction
+				 * following the CALL is pushed on to the stack. Therefore as we
+				 * unwind the stack, the EIP values we find will not point to the
+				 * CALL instruction but instead point to the instruction after the
+				 * CALL.
+				 *
+				 * The test below is a little odd since ip points to the instruction
+				 * after the CALL that threw the exception. If (ip == ei->try_start)
+				 * then the CALL which threw the exception came immediately before
+				 * the try block. If (ip == ei->try_end) then the CALL which threw
+				 * the exception was the last instruction of the try block.
+				 */
+
+				if (ei->try_start < ip && ip <= ei->try_end) { 
 					/* catch block */
 					if (ei->flags == 0 && mono_object_isinst (obj, 
 					        mono_class_get (m->klass->image, ei->token_or_filter))) {
@@ -188,7 +201,8 @@
 			for (i = 0; i < ji->num_clauses; i++) {
 				MonoJitExceptionInfo *ei = &ji->clauses [i];
 
-				if (ei->try_start <= ip && ip < (ei->try_end) &&
+				/* See comment regarding ip above */
+				if (ei->try_start < ip && ip <= ei->try_end &&
 				    (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
 					call_finally (ctx, (unsigned long)ei->handler_start);
 				}
