Skip to content

Commit

Permalink
update rvcount error message (#3504)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y authored Sep 30, 2024
1 parent 6e74e33 commit 1688a7a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Neo.VM/JumpTable/JumpTable.Control.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,11 @@ public virtual void Ret(ExecutionEngine engine, Instruction instruction)
if (context_pop.EvaluationStack != stack_eval)
{
if (context_pop.RVCount >= 0 && context_pop.EvaluationStack.Count != context_pop.RVCount)
throw new InvalidOperationException("RVCount doesn't match with EvaluationStack");
// This exception indicates a mismatch between the expected and actual number of stack items.
// It typically occurs due to compilation errors caused by potential issues in the compiler, resulting in either too many or too few
// items left on the stack compared to what was anticipated by the return value count.
// When you run into this problem, try to reach core-devs at https://github.com/neo-project/neo for help.
throw new InvalidOperationException($"Return value count mismatch: expected {context_pop.RVCount}, but got {context_pop.EvaluationStack.Count} items on the evaluation stack");
context_pop.EvaluationStack.CopyTo(stack_eval);
}
if (engine.InvocationStack.Count == 0)
Expand Down

0 comments on commit 1688a7a

Please sign in to comment.