From 0896b3886295a21479268ccb78651adfff5e5e33 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 08:15:22 +0100 Subject: A save's arrays for many states asked with || (clang's -Wbitwise-instead-of-logical stopped a clang build since 027's 4f-2, so a Mac's: the same frees either way, the second malloc not tried when the first fails); Pure builds and its unit tests pass with clang --- core/module-save.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core/module-save.c') diff --git a/core/module-save.c b/core/module-save.c index 6e204d1..ff76d83 100644 --- a/core/module-save.c +++ b/core/module-save.c @@ -1134,7 +1134,7 @@ PureResult pure_save_commit(PureApp *app, const PureValue *values) { /* A draft a state at most, and three more: on the stack for a few states (027's 4f-2). */ PureDraft *few_drafts[FEW_STATES + 3], **drafts = few_drafts; uint32_t few_states[FEW_STATES + 3], *states = few_states; - if (m->states > FEW_STATES && (!(drafts = malloc((m->states + 3) * sizeof(*drafts))) | + if (m->states > FEW_STATES && (!(drafts = malloc((m->states + 3) * sizeof(*drafts))) || !(states = malloc((m->states + 3) * sizeof(*states))))) { if (drafts != few_drafts) free(drafts); if (states != few_states) free(states); -- cgit v1.2.3