Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: ensure the value in range #828

Merged
merged 14 commits into from
Dec 15, 2023
Merged
2 changes: 2 additions & 0 deletions src/Neo.Compiler.CSharp/MethodConvert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2918,6 +2918,7 @@ private void ConvertLocalIdentifierNamePostIncrementOrDecrementExpression(Syntax
AccessSlot(OpCode.LDLOC, index);
AddInstruction(OpCode.DUP);
EmitIncrementOrDecrement(operatorToken);
EnsureIntegerInRange(symbol.Type);
AccessSlot(OpCode.STLOC, index);
}

Expand Down Expand Up @@ -3146,6 +3147,7 @@ private void ConvertLocalIdentifierNamePreIncrementOrDecrementExpression(SyntaxT
byte index = _localVariables[symbol];
AccessSlot(OpCode.LDLOC, index);
EmitIncrementOrDecrement(operatorToken);
EnsureIntegerInRange(symbol.Type);
AddInstruction(OpCode.DUP);
AccessSlot(OpCode.STLOC, index);
}
Expand Down