Skip to content

Commit 1688a7a

Browse files
author
Jimmy
authored
update rvcount error message (#3504)
1 parent 6e74e33 commit 1688a7a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Neo.VM/JumpTable/JumpTable.Control.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,11 @@ public virtual void Ret(ExecutionEngine engine, Instruction instruction)
539539
if (context_pop.EvaluationStack != stack_eval)
540540
{
541541
if (context_pop.RVCount >= 0 && context_pop.EvaluationStack.Count != context_pop.RVCount)
542-
throw new InvalidOperationException("RVCount doesn't match with EvaluationStack");
542+
// This exception indicates a mismatch between the expected and actual number of stack items.
543+
// It typically occurs due to compilation errors caused by potential issues in the compiler, resulting in either too many or too few
544+
// items left on the stack compared to what was anticipated by the return value count.
545+
// When you run into this problem, try to reach core-devs at https://github.com/neo-project/neo for help.
546+
throw new InvalidOperationException($"Return value count mismatch: expected {context_pop.RVCount}, but got {context_pop.EvaluationStack.Count} items on the evaluation stack");
543547
context_pop.EvaluationStack.CopyTo(stack_eval);
544548
}
545549
if (engine.InvocationStack.Count == 0)

0 commit comments

Comments
 (0)