From 2963fb5a7deb0cca24c3aa410a11ebc0f8fb559a Mon Sep 17 00:00:00 2001 From: eunhhu Date: Thu, 1 Oct 2026 16:29:41 +0100 Subject: Read a list cell's place after finding its leaf, not beside it pure_list_get passed leaf_of(list, at, &within) and within to cell_at in one call: C leaves the order of a call's arguments open, so within could be read before leaf_of set it. gcc 14 on AArch64 called leaf_of first; gcc 13 on x86_64 says within is used uninitialized (found building Pure there, research 029). --- core/module-list.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/module-list.c') diff --git a/core/module-list.c b/core/module-list.c index ac622cc..1f3b900 100644 --- a/core/module-list.c +++ b/core/module-list.c @@ -1087,7 +1087,8 @@ PureResult pure_list_set(PureList *list, size_t at, unsigned field, PureCell val PureCell pure_list_get(const PureList *list, size_t at, unsigned field) { size_t within; - return cell_at(&list->layout, leaf_of(list, at, &within), (unsigned)within, field); + const Node *leaf = leaf_of(list, at, &within); /* first: an argument beside it would be read in either order */ + return cell_at(&list->layout, leaf, (unsigned)within, field); } static void open_run(const Layout *l, const Node *leaf, PureRun *run) { -- cgit v1.2.3