Skip to content

Commit

Permalink
add commont for exception paramcount.
Browse files Browse the repository at this point in the history
  • Loading branch information
lightszero committed Apr 30, 2020
1 parent 5991a10 commit bef47cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Neo.Compiler.MSIL/MSIL/Conv_Multi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down

0 comments on commit bef47cb

Please sign in to comment.