The return value of the method clicked on caller stack . Whether it will be used or not is a caller code question.
EDIT
Example:
void Main() { var result = MyCoolFunc(10, 20); {1} } int MyCoolFunc(int prm1, int prm2) { return (prm1 + prm2); }
Pesudo example of some virtual machine, skipping internal code
VM_PUSH 10 //prm1 stack state is {10} VM_PUSH 20 //prm1 stack state is {10,20} VM_EXEC MyCoolFunc //call function which executes what need, removes from stack those 2 values and pushes result of the function execution. stack state is {30}
if we donβt write var result on the line {1}, it ends here, if yes there should be something like this
VM_ALLOC result //allocate space for result VM_GETFROMSTACK // get content of the stack to result
VM code is PSEUDO CODE and does not exist in real life. It was used only as an example.
source share