From 05ca4b95b8173c7787bfd7407ac67d8079a1f9de Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 26 Mar 2024 14:38:10 -0400 Subject: len fix --- compiler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler.c b/compiler.c index 5ba93ba..2019560 100644 --- a/compiler.c +++ b/compiler.c @@ -4967,7 +4967,7 @@ Variable _eval(Scope *s, CompData *data, Vector *tokens, size_t start, size_t en } else if (tok_str_eq(op_token, "len")){ out = var_init("#literal", typ_get_inbuilt("uint")); out.location = LOC_LITL; - out.offset = rhs.type->size; + out.offset = _var_size(&rhs); var_end(&rhs); return out; } else { @@ -6412,7 +6412,7 @@ int main(int argc, char ** argv) { help(); return 1; } else if (strcmp(argv[1], "-v") == 0) { - printf("C based TNSL Compiler (CTC) - version 0.4\n"); + printf("C based TNSL Compiler (CTC) - version 0.4.1\n"); return 0; } else if (strcmp(argv[1], "-t") == 0) { Artifact in = art_from_str(argv[2], '/'); -- cgit v1.2.3