Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
pop.c File Reference

Implements the OP_POP opcode for removing the top stack value in the VM. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

 exit (1)
 free_value (v)

Variables

case OP_POP
case Runtime error
Value v = pop_value(vm)
 break

Detailed Description

Implements the OP_POP opcode for removing the top stack value in the VM.

This file handles the OP_POP instruction, which removes the top value from the stack.

Behavior:

  • Removes the top value from the stack.

Error Handling:

  • Exits with an error if the stack is empty.

Example: // Bytecode: OP_POP // Stack before: [42] // Stack after: []

Definition in file pop.c.

Function Documentation

◆ exit()

exit(1)

◆ free_value()

free_value(v)

Variable Documentation

◆ break

break

Definition at line 35 of file pop.c.

◆ error

case Runtime error

Definition at line 30 of file pop.c.

◆ OP_POP

case OP_POP

Definition at line 28 of file pop.c.

◆ v

Value v = pop_value(vm)

Definition at line 33 of file pop.c.