From 5a452d2912321252b5c79e864ce505edfcfad9ce Mon Sep 17 00:00:00 2001 From: zoltan Date: Thu, 13 Nov 2008 17:13:43 +0000 Subject: [PATCH] 2008-11-13 Zoltan Varga * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@118729 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/System/System.Text.RegularExpressions/ChangeLog | 4 ++++ class/System/System.Text.RegularExpressions/RxInterpreter.cs | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/class/System/System.Text.RegularExpressions/ChangeLog b/class/System/System.Text.RegularExpressions/ChangeLog index e32ce39cfa..1c283f2528 100644 --- a/class/System/System.Text.RegularExpressions/ChangeLog +++ b/class/System/System.Text.RegularExpressions/ChangeLog @@ -1,3 +1,7 @@ +2008-11-13 Zoltan Varga + + * RxInterpreter.cs: Fix pc computation in various opcodes. Fixes #443841. + 2008-11-11 Zoltan Varga * CILCompiler.cs: Implement Reference opcode. diff --git a/class/System/System.Text.RegularExpressions/RxInterpreter.cs b/class/System/System.Text.RegularExpressions/RxInterpreter.cs index 20298dda9b..77a42c526b 100644 --- a/class/System/System.Text.RegularExpressions/RxInterpreter.cs +++ b/class/System/System.Text.RegularExpressions/RxInterpreter.cs @@ -588,7 +588,7 @@ namespace System.Text.RegularExpressions { pc += program [pc + 1] | ((int)program [pc + 2] << 8); continue; case RxOp.TestCharGroup: - char_group_end = pc + program [pc + 1] | ((int)program [pc + 2] << 8); + char_group_end = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); pc += 3; continue; case RxOp.String: @@ -2145,7 +2145,7 @@ namespace System.Text.RegularExpressions { pc + 11 // subexpression ); - int until = pc + program [pc + 1] | ((int)program [pc + 2] << 8); + int until = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); if (!EvalByteCode (until, strpos, ref res)) { this.repeat = this.repeat.Previous; return false; @@ -2303,7 +2303,7 @@ namespace System.Text.RegularExpressions { */ bool lazy = program [pc] == (byte)RxOp.FastRepeatLazy; int res = 0; - int tail = pc + program [pc + 1] | ((int)program [pc + 2] << 8); + int tail = pc + (program [pc + 1] | ((int)program [pc + 2] << 8)); start = ReadInt (program, pc + 3); end = ReadInt (program, pc + 7); //Console.WriteLine ("min: {0}, max: {1} tail: {2}", start, end, tail); -- 2.11.4.GIT