Fun 0.41.5
The programming language that makes You have fun
Loading...
Searching...
No Matches
get_sp.c
Go to the documentation of this file.
1/*
2 * This file is part of the Fun programming language.
3 * https://fun-lang.xyz/
4 *
5 * Copyright 2026 Johannes Findeisen <you@hanez.org>
6 * Licensed under the terms of the Apache-2.0 license.
7 * https://opensource.org/license/apache-2-0
8 */
9
18
32#ifdef FUN_WITH_RUST
33 extern int fun_op_rget_sp(VM * vm);
34 int rc = fun_op_rget_sp(vm);
35 (void)rc; /* rc currently unused; 0 means OK */
36#else
37 vm_raise_error(vm, "RUST_GET_SP requires FUN_WITH_RUST=ON at build time");
38 push_value(vm, make_int(-1));
39#endif
40 break;
41}
@ OP_RUST_GET_SP
Definition bytecode.h:281
int rc
The Fun virtual machine state.
Definition vm.h:110
Value make_int(int64_t v)
Construct a Value representing a 64-bit integer.
Definition value.c:51
void vm_raise_error(VM *vm, const char *msg)
Raise a runtime error inside the VM, honoring try/catch/finally.
Definition vm.c:248
int fun_op_rget_sp(VM *vm)