From 9de8ac56f23bb3a8a0adb40c359f0a83c839f9f2 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 3 May 2025 20:12:55 +0900 Subject: fizzbuzz --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 5c86d53..13bd3ac 100644 --- a/main.c +++ b/main.c @@ -979,6 +979,7 @@ void gen_func_call(CODEGEN* g, AST* ast) { } } // TODO: rsp align + printf(" mov rax, 0\n"); printf(" call %s\n", func_name); printf(" push rax\n"); } @@ -1141,10 +1142,9 @@ void gen(CODEGEN* g, AST* ast) { printf(".intel_syntax noprefix\n\n"); - int str_index = 1; char** str_lit = ast->str_literals; while (*str_lit) { - printf(".Lstr__%d:\n", str_index); + printf(".Lstr__%d:\n", str_lit - ast->str_literals + 1); printf(" .string \"%s\"\n\n", *str_lit); str_lit += 1; } -- cgit v1.2.3-70-g09d2