Stop pointer parameters leaking value-pool slots
All checks were successful
akbasic CI Build / cmake_build (push) Successful in 3m54s
akbasic CI Build / coverage (push) Successful in 4m10s
akbasic CI Build / sanitizers (push) Successful in 5m16s
akbasic CI Build / akgl_build (push) Successful in 9m43s
akbasic CI Build / mutation_test (push) Successful in 24m33s

Create structure parameters before allocating their representation, then keep pointer references in the call variable's inline slot. Add an 8,000-call regression and document the remaining by-value structure escape limitation.

Co-authored-by: andrew <andrew@aklabs.net>
Co-authored-by: OpenAI Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
2026-08-04 23:09:15 -04:00
parent 350deb3a45
commit 2e60e26b2f
7 changed files with 83 additions and 12 deletions

View File

@@ -246,6 +246,16 @@ akerr_ErrorContext AKERR_NOIGNORE *akbasic_environment_collect_subscripts(akbasi
*/
akerr_ErrorContext AKERR_NOIGNORE *akbasic_environment_create(akbasic_Environment *obj, const char *varname, akbasic_Variable **dest);
/**
* @brief Create a variable slot without allocating value storage.
*
* Used when the caller knows the variable's representation before its first
* initialization, such as a structure parameter. The caller must initialize
* the variable before evaluating it.
*/
akerr_ErrorContext AKERR_NOIGNORE *akbasic_environment_create_empty(akbasic_Environment *obj, const char *varname,
akbasic_Variable **dest);
/**
* @brief Resolve a label to the line number it marks.
* @param obj Scope to search; the parent chain is walked.