aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/codegen.c3
-rw-r--r--src/preprocess.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 19d7079..2e7dc41 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -57,7 +57,8 @@ static void codegen_func_prologue(CodeGen* g, AstNode* ast) {
for (int i = 0; i < ast->node_params->node_len; ++i) {
fprintf(g->out, " push %s\n", param_reg(i));
}
- fprintf(g->out, " sub rsp, %d\n", ast->node_stack_size);
+ // Note: rsp must be aligned to 8.
+ fprintf(g->out, " sub rsp, %d\n", to_aligned(ast->node_stack_size, 8));
}
static void codegen_func_epilogue(CodeGen* g, AstNode* ast) {
diff --git a/src/preprocess.c b/src/preprocess.c
index df688f1..8b52f7c 100644
--- a/src/preprocess.c
+++ b/src/preprocess.c
@@ -969,10 +969,7 @@ static BOOL preprocess_if_group_or_elif_group(Preprocessor* pp, int directive_to
}
static BOOL preprocess_if_group(Preprocessor* pp, int directive_token_pos) {
- // TODO: this code does not work for some reason.
- // return preprocess_if_group_or_elif_group(pp, directive_token_pos, FALSE);
- int x = 0;
- return preprocess_if_group_or_elif_group(pp, directive_token_pos, x);
+ return preprocess_if_group_or_elif_group(pp, directive_token_pos, FALSE);
}
static BOOL preprocess_elif_group(Preprocessor* pp, int directive_token_pos, BOOL did_process) {