diff options
Diffstat (limited to 'src/codegen')
| -rw-r--r-- | src/codegen/codegen.c | 9 | ||||
| -rw-r--r-- | src/codegen/codegen_decl.c | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/codegen/codegen.c b/src/codegen/codegen.c index eef1057..91f5bb5 100644 --- a/src/codegen/codegen.c +++ b/src/codegen/codegen.c @@ -494,7 +494,14 @@ void codegen_expression(ParserContext *ctx, ASTNode *node, FILE *out) else { - fprintf(out, "%lluULL", (unsigned long long)node->literal.int_val); + if (node->literal.int_val > 9223372036854775807ULL) + { + fprintf(out, "%lluULL", (unsigned long long)node->literal.int_val); + } + else + { + fprintf(out, "%llu", (unsigned long long)node->literal.int_val); + } } break; case NODE_EXPR_CALL: diff --git a/src/codegen/codegen_decl.c b/src/codegen/codegen_decl.c index 42e0ba9..2dff0dd 100644 --- a/src/codegen/codegen_decl.c +++ b/src/codegen/codegen_decl.c @@ -738,7 +738,7 @@ void emit_impl_vtables(ParserContext *ctx, FILE *out) while (m) { const char *orig = parse_original_method_name(m->func.name); - fprintf(out, ".%s = (void(*)())%s_%s_%s", orig, strct, trait, orig); + fprintf(out, ".%s = (__typeof__(((%s_VTable*)0)->%s))%s_%s_%s", orig, trait, orig, strct, trait, orig); if (m->next) { fprintf(out, ", "); |
