Skip to content

Commit d96f6a7

Browse files
fix: correct method id for unexamined flow control statements
1 parent 91e8676 commit d96f6a7

8 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎EProjectFile/Statements/CounterStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
5454
using (a.NewBlock(3))
5555
{
5656
if (UnexaminedCode != null)
57-
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70);
57+
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70, 0, 7);
5858
else
5959
new ExpressionStatement(new CallExpression(0, 7, new ParamListExpression() { Count, Var }), MaskOnStart, CommentOnStart).WriteTo(a, 0x70);
6060
Block.WriteTo(a);

‎EProjectFile/Statements/DoWhileStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
5454
a.ExpressionData.Write((byte)0x55);
5555
}
5656
if (UnexaminedCode != null)
57-
new UnexaminedStatement(UnexaminedCode, MaskOnEnd).WriteTo(a, 0x71);
57+
new UnexaminedStatement(UnexaminedCode, MaskOnEnd).WriteTo(a, 0x71, 0, 6);
5858
else
5959
new ExpressionStatement(new CallExpression(0, 6, new ParamListExpression() { Condition }), MaskOnEnd, CommentOnEnd).WriteTo(a, 0x71);
6060
}

‎EProjectFile/Statements/ForStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
5959
using (a.NewBlock(3))
6060
{
6161
if (UnexaminedCode != null)
62-
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70);
62+
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70, 0, 9);
6363
else
6464
new ExpressionStatement(new CallExpression(0, 9, new ParamListExpression() { Start, End, Step, Var }), MaskOnStart, CommentOnStart).WriteTo(a, 0x70);
6565
Block.WriteTo(a);

‎EProjectFile/Statements/IfElseStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
6161
using (a.NewBlock(1))
6262
{
6363
if (UnexaminedCode != null)
64-
new UnexaminedStatement(UnexaminedCode, Mask).WriteTo(a, 0x6B);
64+
new UnexaminedStatement(UnexaminedCode, Mask).WriteTo(a, 0x6B, 0, 0);
6565
else
6666
new ExpressionStatement(new CallExpression(0, 0, new ParamListExpression() { Condition }), Mask, Comment).WriteTo(a, 0x6B);
6767
BlockOnTrue.WriteTo(a);

‎EProjectFile/Statements/IfStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
5252
using (a.NewBlock(2))
5353
{
5454
if (UnexaminedCode != null)
55-
new UnexaminedStatement(UnexaminedCode, Mask).WriteTo(a, 0x6C);
55+
new UnexaminedStatement(UnexaminedCode, Mask).WriteTo(a, 0x6C, 0, 1);
5656
else
5757
new ExpressionStatement(new CallExpression(0, 1, new ParamListExpression() { Condition }), Mask, Comment).WriteTo(a, 0x6C);
5858
Block.WriteTo(a);

‎EProjectFile/Statements/SwitchStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
9494
foreach (var curCase in Case)
9595
{
9696
if (curCase.UnexaminedCode != null)
97-
new UnexaminedStatement(curCase.UnexaminedCode, curCase.Mask).WriteTo(a, 0x6E);
97+
new UnexaminedStatement(curCase.UnexaminedCode, curCase.Mask).WriteTo(a, 0x6E, 0, 2);
9898
else
9999
new ExpressionStatement(new CallExpression(0, 2, new ParamListExpression() { curCase.Condition }), curCase.Mask, curCase.Comment).WriteTo(a, 0x6E);
100100
curCase.Block.WriteTo(a);

‎EProjectFile/Statements/UnexaminedStatement.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ public override void ToTextCode(IdToNameMap nameMap, TextWriter writer, int inde
3333
writer.Write("' ");
3434
writer.Write(unexaminedCode);
3535
}
36-
internal void WriteTo(MethodCodeDataWriterArgs a, byte type)
36+
internal void WriteTo(MethodCodeDataWriterArgs a, byte type, short libraryId, int methodId)
3737
{
3838
a.LineOffest.Write(a.Offest);
3939
a.ExpressionData.Write(type);
40-
a.ExpressionData.Write(0);
41-
a.ExpressionData.Write((short)-1);
40+
a.ExpressionData.Write(methodId);
41+
a.ExpressionData.Write(libraryId);
4242
a.ExpressionData.Write((short)(Mask ? 0 : 0x40));
4343
a.ExpressionData.WriteBStr(a.Encoding, UnexaminedCode);
4444
a.ExpressionData.WriteBStr(a.Encoding, null);
@@ -48,7 +48,7 @@ internal void WriteTo(MethodCodeDataWriterArgs a, byte type)
4848
}
4949
internal override void WriteTo(MethodCodeDataWriterArgs a)
5050
{
51-
WriteTo(a, 0x6A);
51+
WriteTo(a, 0x6A, -1, 0);
5252

5353
}
5454
}

‎EProjectFile/Statements/WhileStatement.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ internal override void WriteTo(MethodCodeDataWriterArgs a)
5050
using (a.NewBlock(3))
5151
{
5252
if (UnexaminedCode != null)
53-
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70);
53+
new UnexaminedStatement(UnexaminedCode, MaskOnStart).WriteTo(a, 0x70, 0, 3);
5454
else
5555
new ExpressionStatement(new CallExpression(0, 3, new ParamListExpression() { Condition }), MaskOnStart, CommentOnStart).WriteTo(a, 0x70);
5656
Block.WriteTo(a);

0 commit comments

Comments
 (0)