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...

Go to the source code of this file.

Variables

case OP_RUST_GET_SP

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.

Definition in file get_sp.c.

Variable Documentation

◆ OP_RUST_GET_SP

case OP_RUST_GET_SP

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 at line 31 of file get_sp.c.