summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2016-01-03 17:52:44 +0800
committerTing-Wei Lan <lantw44@gmail.com>2016-01-03 17:52:44 +0800
commit4a075a02de952d0ec489f60cbb8f534d26ac766e (patch)
treea8b368030537f1d8cec44e19a4f6412730bd2445
parent8ea9812559b02104a0bcf8e31d7d679856c822aa (diff)
downloadcompiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar.gz
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar.bz2
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar.lz
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar.xz
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.tar.zst
compiler2015-4a075a02de952d0ec489f60cbb8f534d26ac766e.zip
Add missing colons after label names
-rw-r--r--src/code-generation.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/code-generation.c b/src/code-generation.c
index c2dbd78..8bf85a9 100644
--- a/src/code-generation.c
+++ b/src/code-generation.c
@@ -616,7 +616,7 @@ static void generate_statement(
CcmmcTmp *result = ccmmc_register_alloc(state->reg_pool, &current_offset);
// while condition
- fprintf(state->asm_output, ".LC%zu\n", label_cmp);
+ fprintf(state->asm_output, ".LC%zu:\n", label_cmp);
generate_expression(stmt->child, state, result, &current_offset);
result_reg = ccmmc_register_lock(state->reg_pool, result);
if (stmt->child->type_value == CCMMC_AST_VALUE_FLOAT)
@@ -641,7 +641,7 @@ static void generate_statement(
state, current_offset);
fprintf(state->asm_output,
"\tb\t.LC%zu\n"
- ".LC%zu\n",
+ ".LC%zu:\n",
label_cmp,
label_exit);
#undef FPREG_TMP
@@ -685,21 +685,21 @@ static void generate_statement(
if (stmt->child->right_sibling->right_sibling->type_node
== CCMMC_AST_NODE_NUL) {
// no else
- fprintf(state->asm_output, ".LC%zu\n", label_cross_if);
+ fprintf(state->asm_output, ".LC%zu:\n", label_cross_if);
}
else {
// jump across else
size_t label_exit = state->label_number++;
fprintf(state->asm_output,
"\tb\t.LC%zu\n"
- ".LC%zu\n",
+ ".LC%zu:\n",
label_exit,
label_cross_if);
// else body
generate_statement(stmt->child->right_sibling->right_sibling,
state, current_offset);
- fprintf(state->asm_output, ".LC%zu\n", label_exit);
+ fprintf(state->asm_output, ".LC%zu:\n", label_exit);
#undef FPREG_TMP
}
} break;