Stop pointer parameters leaking value-pool slots #43

Merged
andrew merged 4 commits from 36 into main 2026-08-06 12:38:29 -04:00
Showing only changes of commit 5c04edc5fb - Show all commits

View File

@@ -364,6 +364,14 @@ static akerr_ErrorContext *environment_create_named(akbasic_Environment *obj, co
SUCCEED_RETURN(errctx);
}
/**
* @brief Find a variable in this scope, creating and initializing it if absent.
*
* @param obj The scope to search and, on a miss, to create in.
* @param varname Name including its type suffix.
* @param dest Output destination populated with the variable.
* @return `NULL` on success, otherwise an error context owned by the caller.
*/
akerr_ErrorContext *akbasic_environment_create(akbasic_Environment *obj, const char *varname, akbasic_Variable **dest)
{
PREPARE_ERROR(errctx);
@@ -372,6 +380,16 @@ akerr_ErrorContext *akbasic_environment_create(akbasic_Environment *obj, const c
SUCCEED_RETURN(errctx);
}
/**
* @brief Find a variable in this scope, creating it without value storage if absent.
*
* The caller must initialize the variable before evaluating it.
*
* @param obj The scope to search and, on a miss, to create in.
* @param varname Name including its type suffix.
* @param dest Output destination populated with the variable.
* @return `NULL` on success, otherwise an error context owned by the caller.
*/
akerr_ErrorContext *akbasic_environment_create_empty(akbasic_Environment *obj, const char *varname,
akbasic_Variable **dest)
{