diff --git a/src/Neo.Compiler.MSIL/MSIL/Conv_Multi.cs b/src/Neo.Compiler.MSIL/MSIL/Conv_Multi.cs index 0928d7e66..9eb505553 100644 --- a/src/Neo.Compiler.MSIL/MSIL/Conv_Multi.cs +++ b/src/Neo.Compiler.MSIL/MSIL/Conv_Multi.cs @@ -1314,16 +1314,16 @@ private int ConvertNewObj(ILMethod from, OpCode src, NeoMethod to) { // NeoVM `catch` instruction need one exception parameter Convert1by1(VM.OpCode.NOP, src, to); + var pcount = _type.Parameters.Count; + //pcount must be 1 + //if more then one, drop them. + //if pcount==0,add one. if (pcount == 0) // If there is no parameter, insert one pararmeter { ConvertPushString("usererror", src, to); } - else if (pcount == 1) - { - - } - else + else if (pcount > 1) { // Keep the first exception parameter for (var i = 0; i < pcount - 1; i++)