From 18d3c17a36fa7b330c996a781aff957cbdaee698 Mon Sep 17 00:00:00 2001 From: A404M Date: Wed, 4 Jun 2025 10:33:15 +0330 Subject: fix bug in array objects --- code/main.felan | 3 +++ src/runner/runner.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/main.felan b/code/main.felan index ebb9cd5..0e072c4 100644 --- a/code/main.felan +++ b/code/main.felan @@ -25,6 +25,9 @@ t :: (comptime formatter : string) -> void { }; main :: () -> void { + a := '2'; + @insert("a = '3';a = '5';"); + print_char(a); t("hello {world}"); }; diff --git a/src/runner/runner.c b/src/runner/runner.c index 2458cfe..984c7d6 100644 --- a/src/runner/runner.c +++ b/src/runner/runner.c @@ -1964,7 +1964,7 @@ AstTree *toRawValue(AstTree *value, AstTreeScope *scope) { if (value->type->token == AST_TREE_TOKEN_TYPE_ARRAY) { u8 *ptr = stackAlloc(size, scope); ((u64 *)rawValue)[0] = (u64)ptr; - ((u64 *)rawValue)[1] = size; + ((u64 *)rawValue)[1] = object->items_size; size_t filledSize = 0; for (size_t i = 0; i < object->items_size; ++i) { -- cgit v1.2.3