Fun 0.41.5
The programming language that makes you have fun!
Loading...
Searching...
No Matches
get_sp.c File Reference

Implements the OP_RUST_GET_SP opcode (conditional build). More...

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

Go to the source code of this file.

Variables

case OP_RUST_GET_SP
int rc = fun_op_rget_sp(vm)
 break

Detailed Description

Implements the OP_RUST_GET_SP opcode (conditional build).

Delegates to a Rust helper to read the VM's current stack pointer (sp). When Rust support is disabled, this raises a runtime error and pushes -1 to signal unavailability.

OP_RUST_GET_SP: () -> int | Nil

Behavior (FUN_WITH_RUST=ON):

  • Does not pop any values.
  • Invokes fun_op_rget_sp(vm). The Rust helper may push the result or otherwise communicate it. The C side does not directly push here.

Behavior (FUN_WITH_RUST=OFF):

  • Raises a runtime error indicating missing Rust support.
  • Pushes integer -1 as a sentinel value.

Definition in file get_sp.c.

Variable Documentation

◆ break

break

Definition at line 39 of file get_sp.c.

◆ OP_RUST_GET_SP

case OP_RUST_GET_SP

Definition at line 30 of file get_sp.c.

◆ rc

void rc = fun_op_rget_sp(vm)

Definition at line 33 of file get_sp.c.