--- C:\DOCUME~1\Lotfi\LOCALS~1\Temp\MethodBody.cs-revBASE.svn001.tmp.cs	sam. avr. 18 15:12:00 2009
+++ E:\Cecil\Nouveau dossier\Mono.Cecil.Cil\MethodBody.cs	sam. avr. 18 15:12:48 2009
@@ -525,22 +525,21 @@
 
 		void OptimizeBranches ()
 		{
-			ComputeOffsets ();
+			ComputeOffsets(m_instructions[0], 0);
 
 			foreach (Instruction instr in m_instructions) {
 				if (instr.OpCode.OperandType != OperandType.InlineBrTarget)
 					continue;
 
-				if (OptimizeBranch (instr))
-					ComputeOffsets ();
+				OptimizeBranch (instr);
 			}
 		}
 
-		static bool OptimizeBranch (Instruction instr)
+		static void OptimizeBranch (Instruction instr)
 		{
 			int offset = ((Instruction) instr.Operand).Offset - (instr.Offset + instr.OpCode.Size + 4);
 			if (! (offset >= -128 && offset <= 127))
-				return false;
+				return;
 
 			switch (instr.OpCode.Code) {
 			case Code.Br:
@@ -587,17 +586,18 @@
 				break;
 			}
 
-			return true;
+			Instruction firstInstruction = offset >= 0 ? instr : (Instruction)instr.Operand;
+			ComputeOffsets(firstInstruction, firstInstruction.Offset);
 		}
 
-		void ComputeOffsets ()
+		static void ComputeOffsets (Instruction instr, int offset)
 		{
-			int offset = 0;
-
-			foreach (Instruction instr in m_instructions) {
+			do{
 				instr.Offset = offset;
 				offset += instr.GetSize ();
+				instr = instr.Next;
 			}
+			while (instr != null);
 		}
 
 		static void Modify (Instruction i, OpCode op, object operand)
