From 00428a0bdf534c2a82450739f36c6d6da24d2479 Mon Sep 17 00:00:00 2001 From: Maxwell Jeffress Date: Sat, 4 Jul 2026 11:32:36 +1000 Subject: [PATCH] function args --- src/New/BytecodeValue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/New/BytecodeValue.c b/src/New/BytecodeValue.c index f3cb70e..0b075c5 100644 --- a/src/New/BytecodeValue.c +++ b/src/New/BytecodeValue.c @@ -31,7 +31,7 @@ static inline GroundBytecodeFunction doFunction(GroundFunction* function) { } // Create a state with function paramaters as first things inside state - GroundState state = {NULL, NULL, NULL, 0}; + GroundState state = {NULL, NULL, NULL, bf.args.count}; for (GroundSize i = 0; i < bf.args.count; i++) { GroundVariable* var = malloc(sizeof(GroundVariable)); if (var == NULL) { @@ -40,6 +40,7 @@ static inline GroundBytecodeFunction doFunction(GroundFunction* function) { return bf; } snprintf(var->name, 2047, "%s", function->args.at[i].as.id->string); + var->_offset = i; HASH_ADD_STR(state.variables, name, var); }