diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-05-03 20:12:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-05-03 20:12:55 +0900 |
| commit | 9de8ac56f23bb3a8a0adb40c359f0a83c839f9f2 (patch) | |
| tree | 8955f4246bb3b2c2471eaf2bd8fedb3e425d4616 /main.c | |
| parent | 7570e8a0af6b4d8ea28d422cd8e4645fb23300af (diff) | |
| download | P4Dcc-9de8ac56f23bb3a8a0adb40c359f0a83c839f9f2.tar.gz P4Dcc-9de8ac56f23bb3a8a0adb40c359f0a83c839f9f2.tar.zst P4Dcc-9de8ac56f23bb3a8a0adb40c359f0a83c839f9f2.zip | |
fizzbuzz
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |
