1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-18 06:34:48 +00:00

Fix issue with environments in asm.c

This commit is contained in:
Calvin Rose 2023-02-02 21:12:17 -06:00
parent f4bc89d1c0
commit 0aded71343

View File

@ -761,10 +761,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");