From 282546c03fcecdb865e29b850eeac771c07175d6 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Thu, 2 Feb 2023 21:12:17 -0600 Subject: [PATCH] Fix issue with environments in asm.c --- src/core/asm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/asm.c b/src/core/asm.c index 1cf2c57a..2025b9fb 100644 --- a/src/core/asm.c +++ b/src/core/asm.c @@ -722,10 +722,10 @@ static JanetAssembleResult janet_asm1(JanetAssembler *parent, Janet source, int } /* Set environments */ - def->environments = janet_realloc(def->environments, def->environments_length * sizeof(int32_t)); x = janet_get1(s, janet_ckeywordv("environments")); if (janet_indexed_view(x, &arr, &count)) { def->environments_length = count; + def->environments = janet_realloc(def->environments, def->environments_length * sizeof(int32_t)); for (int32_t i = 0; i < count; i++) { if (!janet_checkint(arr[i])) { janet_asm_error(&a, "expected integer");