diff options
author | Michael Mayr <mayr_michael@gmx.at> | 2017-05-16 18:46:43 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2017-05-16 18:46:43 +0300 |
commit | b71da7ab8db264db1c08b5a044710cde38bf53d1 (patch) | |
tree | 8f21b4025a92b8de20e8cc5bc1b570e77b031463 /src | |
parent | c78fd42d4a2025bda10093e636833c178266d121 (diff) |
Implemented ImportUnaryOperation (#3624)
Diffstat (limited to 'src')
-rw-r--r-- | src/ILVerify/src/ILImporter.Verify.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ILVerify/src/ILImporter.Verify.cs b/src/ILVerify/src/ILImporter.Verify.cs index c5c4fcfd9..726ccb6f2 100644 --- a/src/ILVerify/src/ILImporter.Verify.cs +++ b/src/ILVerify/src/ILImporter.Verify.cs @@ -1474,7 +1474,22 @@ namespace Internal.IL void ImportUnaryOperation(ILOpcode opCode) { - throw new NotImplementedException($"{nameof(ImportUnaryOperation)} not implemented"); + var operand = Pop(); + + switch (opCode) + { + case ILOpcode.neg: + CheckIsNumeric(operand); + break; + case ILOpcode.not: + CheckIsInteger(operand); + break; + default: + Debug.Assert(false, "Unexpected branch opcode"); + break; + } + + Push(StackValue.CreatePrimitive(operand.Kind)); } void ImportCpOpj(int token) |